use of org.eclipse.jst.server.core.JndiObject in project webtools.servertools by eclipse.
the class GenericServerLaunchableAdapterDelegate method prepareJndiLaunchable.
private Object prepareJndiLaunchable(IModuleArtifact moduleObject, ServerDelegate delegate) {
JndiLaunchable launchable = null;
GenericServer genericServer = (GenericServer) delegate;
ServerRuntime definition = genericServer.getServerDefinition();
Properties props = new Properties();
props.put(JAVA_NAMING_FACTORY_INITIAL_PROPKEY, definition.getJndiConnection().getInitialContextFactory());
props.put(JAVA_NAMING_PROVIDER_URL_PROPKEY, definition.getJndiConnection().getProviderUrl());
List jps = definition.getJndiConnection().getJndiProperty();
Iterator propsIt = jps.iterator();
while (propsIt.hasNext()) {
ArgumentPair prop = (ArgumentPair) propsIt.next();
props.put(prop.getName(), prop.getValue());
}
if (moduleObject instanceof EJBBean) {
EJBBean bean = (EJBBean) moduleObject;
launchable = new JndiLaunchable(props, bean.getJndiName());
}
if (moduleObject instanceof JndiObject) {
JndiObject jndi = (JndiObject) moduleObject;
launchable = new JndiLaunchable(props, jndi.getJndiName());
}
return launchable;
}
Aggregations