A moment ago I was inspired to make an easy way to start the remote protocols when you're in an embedded scenario. Here's what inspired me :)

http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3996000#3996000

Such a thing has always been "doable" -- the servlet that embedds OpenEJB does it just fine -- we just lacked the ability to configure this easily in other environments. So I'm adding the right bits and bobs.

Remote Services can be enabled while in an embedded mode via setting the property 'openejb.embedded.remotable' to true either in the system properties or as follows:

properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
        properties.setProperty("openejb.embedded.remotable", "true");

        initialContext = new InitialContext(properties);


When your app boots, you'll just need to make sure you have the openejb-ejbd-*.jar + deps in your classpath and you'll see this:

 -------------------------------------------------------
  T E S T S
 -------------------------------------------------------
 Running org.apache.openejb.examples.calculator.CalculatorTest
 log4j:WARN No appenders could be found for logger (OpenEJB).
 log4j:WARN Please initialize the log4j system properly.
 Apache OpenEJB 3.0-incubating-SNAPSHOT    build: 20061228-01:10
 http://incubator.apache.org/openejb
01:17:41,930 INFO [startup] Found EjbModule in classpath: /Users/ dblevins/work/openejb3/examples/calculator-stateless-pojo/target/classes 01:17:42,857 WARN [startup] No ejb-jar.xml found assuming annotated beans present: module: /Users/dblevins/work/openejb3/ examples/calculator-stateless-pojo/target/classes 01:17:42,894 WARN [OpenEJB] Auto-deploying ejb CalculatorImpl: EjbDeployment(deployment-id=CalculatorImpl, container-id=Default Stateless Container) 01:17:42,894 WARN [OpenEJB] Auto-creating a container for bean CalculatorImpl: Container(type=STATELESS, id=Default Stateless Container) 01:17:42,916 INFO [startup] Loaded Module: /Users/dblevins/work/ openejb3/examples/calculator-stateless-pojo/target/classes
 01:17:43,380 INFO  [startup] OpenEJB ready.
 OpenEJB ready.
   ** Starting Services **
   NAME                 IP              PORT
   ejbd                 0.0.0.0         4201
   admin thread         0.0.0.0         4200
 -------
 Ready!
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.851 sec

 Results :
 Tests run: 2, Failures: 0, Errors: 0, Skipped: 0

This output was taken from the calculator-stateless-pojo which I've temporarily hacked to use as a test case.

Going to try and get a better example created.

-David


Reply via email to