use of org.eclipse.jst.server.generic.servertype.definition.ArgumentPair in project webtools.servertools by eclipse.
the class GenericServerBehaviour method getEnvironmentVariables.
protected Map getEnvironmentVariables(LaunchConfiguration config) {
List variables = config.getEnvironmentVariable();
Map<String, String> varsMap = new HashMap<String, String>(variables.size());
Iterator iterator = variables.iterator();
while (iterator.hasNext()) {
ArgumentPair pair = (ArgumentPair) iterator.next();
varsMap.put(pair.getName(), getServerDefinition().getResolver().resolveProperties(pair.getValue()));
}
return varsMap;
}
use of org.eclipse.jst.server.generic.servertype.definition.ArgumentPair 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;
}
use of org.eclipse.jst.server.generic.servertype.definition.ArgumentPair in project webtools.servertools by eclipse.
the class ServerTypeDefinitionModelTest method testJNDIConnection.
public void testJNDIConnection() {
JndiConnection jndi = subject.getJndiConnection();
assertNotNull(jndi);
assertTrue(jndi.getProviderUrl() != null && jndi.getProviderUrl().length() > 0);
assertTrue(jndi.getInitialContextFactory() != null && jndi.getInitialContextFactory().length() > 0);
assertNotNull(jndi.getJndiProperty());
if (jndi.getJndiProperty().size() > 0) {
ArgumentPair property = (ArgumentPair) jndi.getJndiProperty().get(0);
assertNotNull(property.getName());
assertNotNull(property.getValue());
}
}
Aggregations