use of org.apache.cxf.jca.servant.EJBEndpoint in project cxf by apache.
the class JCABusFactory method initializeServantsFromProperties.
private void initializeServantsFromProperties(Properties ejbServants) throws ResourceException {
deregisterServants(bus);
LOG.info("Initializing EJB endpoints from properties file...");
try {
Enumeration<?> keys = ejbServants.keys();
while (keys.hasMoreElements()) {
String theJNDIName = (String) keys.nextElement();
String value = (String) ejbServants.get(theJNDIName);
EJBServantConfig config = new EJBServantConfig(theJNDIName, value);
EJBEndpoint ejbEndpoint = new EJBEndpoint(config);
ejbEndpoint.setEjbServantBaseURL(mcf.getEJBServantBaseURL());
ejbEndpoint.setWorkManager(getWorkManager());
Server servant = ejbEndpoint.publish();
synchronized (servantsCache) {
if (servant != null) {
servantsCache.add(servant);
}
}
}
} catch (Exception e) {
e.printStackTrace();
throw new ResourceException(new Message("FAIL_TO_START_EJB_SERVANTS", BUNDLE).toString(), e);
}
}
Aggregations