tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] OpenEJB > Local Server
Date Wed, 11 May 2011 17:36:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=OPENEJB&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/OPENEJB/Local+Server">Local
Server</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~dblevins">David
Blevins</a>
    </h4>
        <div id="versionComment">
        <b>Comment:</b>
        Reverted from v. 2<br />
    </div>
        <br/>
                         <h4>Changes (3)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-unchanged" >!http://www.openejb.org/images/diagram-local-server.gif|valign=top,
align=right, hspace=15! <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h1.
Accessing EJBs Locally <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{include:OPENEJBx30:Embedding}</span>
<span class="diff-added-words"style="background-color: #dfd;"> </span> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">When
OpenEJB embedded in your app, server, IDE, or JUnit, you can use what we call the Local Server
and avoid the network overhead and enjoy an easy way to embedd OpenEJB. <br> <br>h1.
Say what?! A local server? <br> <br>Yes, you read correctly. OpenEJB can be embedded
and treated as your very own personal EJB container. <br> <br>If they can have
Local and Remote EJB&#39;s, why not Local and Remote EJB Servers too? <br> <br>Haven&#39;t
you ever wanted EJBs without the heavy? I mean you need the &quot;heavy&quot; eventually,
but not while you&#39;re developing. Well, there&#39;s the advantage of an EJB implementation
that was designed with a very clean and well defined server-container contract, you can cut
the server part out completely! <br> <br>So, if you wish to access ejbs locally
and not in client/server mode, you can do so by embedding OpenEJB as a library and accessing
ejbs through OpenEJB&#39;s built-in IntraVM (Local) Server. Why would someone want to
do this? <br>* Your application is a server or other middleware <br>* You want
to write an app that can be both stand alone *and* distributed <br>* To test your EJBs
with JUnit and don&#39;t want to start/stop servers and other nonsense <br>* Imagine
the power from being able to use your IDE debugger to step from your Client all the way into
your EJB and back with no remote debugging voodoo. <br> <br>In this case, your
application, test suite, IDE, or client accesses beans as you would from any other EJB Server.
The EJB Server just happens to be running in the same virtual machine as your application.
This EJB Server is thusly called the IntraVM Server, and, for all intense purposes, your application
an IntraVM Client. <br> <br>There are some interesting differences though. The
IntraVM Server isn&#39;t a heavyweight server as one normally associates with EJB. It
doesn&#39;t open connections, launch threads for processing requests, introduce complex
classloading heirarchies, or any of those &quot;heavy&quot; kind of things. All it
does is dish out proxies to your app that can be used to shoot calls right into the EJB Container.
Very light, very fast, very easy for testing, debugging, developing, etc. <br> <br>h1.
Embedding OpenEJB Dynamically <br> <br>Read the [Embedding] guide for all the
details on how to embed OpenEJB in a Plain Old Java Program (POJP) -- how&#39;s that for
an acronym. <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p><span class="image-wrap" style="float: right"><img src="http://www.openejb.org/images/diagram-local-server.gif"
hspace="15" style="border: 0px solid black" /></span></p>
<h1><a name="LocalServer-AccessingEJBsLocally"></a>Accessing EJBs Locally</h1>

<p>When OpenEJB embedded in your app, server, IDE, or JUnit, you can use what we call
the Local Server and avoid the network overhead and enjoy an easy way to embedd OpenEJB.</p>

<h1><a name="LocalServer-Saywhat%3F%21Alocalserver%3F"></a>Say what?! A
local server?</h1>

<p>Yes, you read correctly. OpenEJB can be embedded and treated as your very own personal
EJB container.</p>

<p>If they can have Local and Remote EJB's, why not Local and Remote EJB Servers too?</p>

<p>Haven't you ever wanted EJBs without the heavy? I mean you need the "heavy" eventually,
but not while you're developing. Well, there's the advantage of an EJB implementation that
was designed with a very clean and well defined server-container contract, you can cut the
server part out completely!</p>

<p>So, if you wish to access ejbs locally and not in client/server mode, you can do
so by embedding OpenEJB as a library and accessing ejbs through OpenEJB's built-in IntraVM
(Local) Server. Why would someone want to do this?</p>
<ul>
	<li>Your application is a server or other middleware</li>
	<li>You want to write an app that can be both stand alone <b>and</b> distributed</li>
	<li>To test your EJBs with JUnit and don't want to start/stop servers and other nonsense</li>
	<li>Imagine the power from being able to use your IDE debugger to step from your Client
all the way into your EJB and back with no remote debugging voodoo.</li>
</ul>


<p>In this case, your application, test suite, IDE, or client accesses beans as you
would from any other EJB Server. The EJB Server just happens to be running in the same virtual
machine as your application. This EJB Server is thusly called the IntraVM Server, and, for
all intense purposes, your application an IntraVM Client.</p>

<p>There are some interesting differences though. The IntraVM Server isn't a heavyweight
server as one normally associates with EJB. It doesn't open connections, launch threads for
processing requests, introduce complex classloading heirarchies, or any of those "heavy" kind
of things. All it does is dish out proxies to your app that can be used to shoot calls right
into the EJB Container. Very light, very fast, very easy for testing, debugging, developing,
etc.</p>

<h1><a name="LocalServer-EmbeddingOpenEJBDynamically"></a>Embedding OpenEJB
Dynamically</h1>

<p>Read the <a href="/confluence/display/OPENEJB/Embedding" title="Embedding">Embedding</a>
guide for all the details on how to embed OpenEJB in a Plain Old Java Program (POJP) &#8211;
how's that for an acronym.</p>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/OPENEJB/Local+Server">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=26515&revisedVersion=4&originalVersion=3">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/OPENEJB/Local+Server?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message