@Test public void canLookup_testFacadeBean_usingServiceLocatorBuilder() throws Exception { JndiServiceLocator loc = ServiceLocatorBuilder.buildRemote() .remoteServer("localhost", 18080) .appName("") .moduleName("test") .createServiceLocator(); // TestRemote testRemote = loc.lookup(TestRemote.class); TestRemote testRemote = loc.lookup("TestRemoteInterfaceBean!" + TestRemote.class.getName()); Assert.assertEquals("TestRemoteBean says hello to ServiceLocatorBuilder", testRemote.getGreeting("ServiceLocatorBuilder")); } }
@Test public void canLookup_testFacadeBean_usingServiceLocatorBuilder() throws Exception { JndiServiceLocator loc = ServiceLocatorBuilder.buildRemote() .remoteServer("localhost", 18080) .appName("") .moduleName("test") .createServiceLocator(); // TestRemote testRemote = loc.lookup(TestRemote.class); TestRemote testRemote = loc.lookup("TestRemoteInterfaceBean!" + TestRemote.class.getName()); Assert.assertEquals("TestRemoteBean says hello to ServiceLocatorBuilder", testRemote.getGreeting("ServiceLocatorBuilder")); } }
/** * Builds a remote service locator based on the values of configuration properties * using the default JU Property chain. * * @return Remote service locator */ public static JndiServiceLocator createRemoteByConfigurationFiles() { PropertyChain pc = JuUtils.getJuPropertyChain(); Integer port = pc.get("ju-util-ee.remote.port", Integer.class, true); Integer portOffset = pc.get("ju-util-ee.portOffset", Integer.class, true); return buildRemote() .remoteServer(pc.get("ju-util-ee.remote.host", true), port + portOffset) .appName(pc.get("ju-util-ee.remote.appName", true)) .moduleName(pc.get("ju-util-ee.remote.moduleName", true)) .createServiceLocator(); }
/** * Initializes the remote service locator based on the values of configuration properties * using the default JU Property chain. * * @return Builder to adapt configuration */ public RemoteServiceLocatorBuilder initByConfigurationFiles() { PropertyChain pc = JuUtils.getJuPropertyChain(); Integer port = pc.get("ju-util-ee.remote.port", Integer.class, true); Integer portOffset = pc.get("ju-util-ee.portOffset", Integer.class, true); this.remoteServer(pc.get("ju-util-ee.remote.host", true), port + portOffset); this.appName(pc.get("ju-util-ee.remote.appName", true)); this.moduleName(pc.get("ju-util-ee.remote.moduleName", true)); return this; }
/** * Builds a remote service locator based on the values of configuration properties * using the default JU Property chain. * * @return Remote service locator */ public static JndiServiceLocator createRemoteByConfigurationFiles() { PropertyChain pc = JuUtils.getJuPropertyChain(); Integer port = pc.get("ju-util-ee.remote.port", Integer.class, true); Integer portOffset = pc.get("ju-util-ee.portOffset", Integer.class, true); return buildRemote() .remoteServer(pc.get("ju-util-ee.remote.host", true), port + portOffset) .appName(pc.get("ju-util-ee.remote.appName", true)) .moduleName(pc.get("ju-util-ee.remote.moduleName", true)) .createServiceLocator(); }
/** * Initializes the remote service locator based on the values of configuration properties * using the default JU Property chain. * * @return Builder to adapt configuration */ public RemoteServiceLocatorBuilder initByConfigurationFiles() { PropertyChain pc = JuUtils.getJuPropertyChain(); Integer port = pc.get("ju-util-ee.remote.port", Integer.class, true); Integer portOffset = pc.get("ju-util-ee.portOffset", Integer.class, true); this.remoteServer(pc.get("ju-util-ee.remote.host", true), port + portOffset); this.appName(pc.get("ju-util-ee.remote.appName", true)); this.moduleName(pc.get("ju-util-ee.remote.moduleName", true)); return this; }