Search in sources :

Example 1 with RemoteInitialContextFactory

use of org.apache.openejb.client.RemoteInitialContextFactory in project tomee by apache.

the class javaURLContextFactory method getObjectInstance.

@Override
public Object getObjectInstance(final Object obj, final Name name, final Context nameCtx, final Hashtable<?, ?> environment) throws Exception {
    final RemoteInitialContextFactory context = new RemoteInitialContextFactory();
    final String serverUri = System.getProperty("openejb.server.uri");
    final String moduleId = System.getProperty("openejb.client.moduleId");
    final Properties props = new Properties();
    props.setProperty(Context.PROVIDER_URL, serverUri);
    props.setProperty("openejb.client.moduleId", moduleId);
    return context.getInitialContext(props);
}
Also used : RemoteInitialContextFactory(org.apache.openejb.client.RemoteInitialContextFactory) Properties(java.util.Properties)

Aggregations

Properties (java.util.Properties)1 RemoteInitialContextFactory (org.apache.openejb.client.RemoteInitialContextFactory)1