use of org.eclipse.jst.server.generic.servertype.definition.ServerRuntime 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.ServerRuntime in project webtools.servertools by eclipse.
the class ExternalServerBehaviour method setupLaunchConfiguration.
/**
* Override superclass method to correctly setup the launch configuration for starting an external
* server.
* @param workingCopy
* @param monitor
* @throws CoreException
*/
public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IProgressMonitor monitor) throws CoreException {
clearDebuggingConfig();
ServerRuntime serverDef = getServerDefinition();
Resolver resolver = serverDef.getResolver();
workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, resolver.resolveProperties(serverDef.getStart().getWorkingDirectory()));
String external = resolver.resolveProperties(getExternalForOS(serverDef.getStart().getExternal()));
workingCopy.setAttribute(ExternalLaunchConfigurationDelegate.COMMANDLINE, external);
workingCopy.setAttribute(ExternalLaunchConfigurationDelegate.DEBUG_PORT, resolver.resolveProperties(serverDef.getStart().getDebugPort()));
workingCopy.setAttribute(ExternalLaunchConfigurationDelegate.HOST, getServer().getHost());
// just use the commandline for now
workingCopy.setAttribute(ExternalLaunchConfigurationDelegate.EXECUTABLE_NAME, external);
Map environVars = getEnvironmentVariables(getServerDefinition().getStart());
if (!environVars.isEmpty()) {
workingCopy.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, environVars);
}
String existingProgArgs = workingCopy.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String) null);
String serverProgArgs = getProgramArguments();
if (existingProgArgs == null || existingProgArgs.indexOf(serverProgArgs) < 0) {
workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, serverProgArgs);
}
}
use of org.eclipse.jst.server.generic.servertype.definition.ServerRuntime in project webtools.servertools by eclipse.
the class PropertyImpl method getLabel.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
public String getLabel() {
if (label.startsWith("%", 0)) {
ServerRuntime rt = (ServerRuntime) eResource().getContents().get(0);
Bundle bundle = Platform.getBundle(rt.getConfigurationElementNamespace());
return Platform.getResourceString(bundle, label);
}
return label;
}
use of org.eclipse.jst.server.generic.servertype.definition.ServerRuntime in project webtools.servertools by eclipse.
the class GenericServerRuntimeWizardFragment method createContent.
public void createContent(Composite parent, IWizardHandle handle) {
Map properties = null;
ServerRuntime definition = null;
if (getRuntimeDelegate() != null) {
properties = getRuntimeDelegate().getServerInstanceProperties();
definition = getServerTypeDefinition(getServerDefinitionId(), properties);
}
IInstallableRuntime ir = ServerPlugin.findInstallableRuntime(getRuntimeDelegate().getRuntime().getRuntimeType().getId());
if (ir != null) {
fDecorators = new GenericServerCompositeDecorator[3];
fDecorators[0] = new JRESelectDecorator(getRuntimeDelegate(), getWizard());
fDecorators[1] = new ServerTypeDefinitionRuntimeDecorator(definition, properties, getWizard(), getRuntimeDelegate());
fDecorators[2] = new InstallableRuntimeDecorator(getWizard(), getRuntimeDelegate());
} else {
fDecorators = new GenericServerCompositeDecorator[2];
fDecorators[0] = new JRESelectDecorator(getRuntimeDelegate(), getWizard());
fDecorators[1] = new ServerTypeDefinitionRuntimeDecorator(definition, properties, getWizard(), getRuntimeDelegate());
}
new GenericServerComposite(parent, fDecorators);
}
use of org.eclipse.jst.server.generic.servertype.definition.ServerRuntime in project webtools.servertools by eclipse.
the class GenericServerWizardFragment method createContent.
public void createContent(Composite parent, IWizardHandle handle) {
IServerWorkingCopy server = getServer();
GenericServer dl = (GenericServer) server.loadAdapter(GenericServer.class, null);
ServerRuntime definition = getServerTypeDefinitionFor(server);
fDecorators = new GenericServerCompositeDecorator[1];
fDecorators[0] = new ServerTypeDefinitionServerDecorator(definition, null, getWizard(), dl);
new GenericServerComposite(parent, fDecorators);
}
Aggregations