| 
| Adding JBoss runtime configuration from plugin [message #187603] | Tue, 06 February 2007 10:44  |  | 
| Eclipse User  |  |  |  |  | How can I can add JBoss runtime configuration from plugin. 
 Code below creates Runtime configuration, but it does not set add JBoss
 root location. As I understand that I should send property
 "serverRootDirectory" to configuration bu I didn't way how.
 
 I will very appreciate for any help
 Mark
 
 
 IServerType serverTypeJBoss4 = ServerCore
 findServerType("org.eclipse.jst.server.generic.jboss4");
 if (serverTypeJBoss4 != null)
 {
 IRuntimeType runtimeType = serverTypeJBoss4.getRuntimeType();
 if (runtimeType != null)
 {
 IRuntimeWorkingCopy runtimeWorkingCopy = runtimeType.createRuntime(
 "jboss.runtime", monitor);
 
 runtimeWorkingCopy.setLocation(newPath(jbossHomeDir.getCanon icalPath()));
 runtimeWorkingCopy.save(true, monitor);
 }
 }
 |  |  |  | 
| 
| Re: Adding JBoss runtime configuration from plugin [message #187644 is a reply to message #187603] | Wed, 07 February 2007 01:04   |  | 
| Eclipse User  |  |  |  |  | Below is a code snippet from the junit tests for jonas. It show the way to add attributes to a generic server. Of course jboss has a different
 set of properties.
 
 GenericServerRuntime runtimeDelegate =
 (GenericServerRuntime)runtimeWorkingCopy.loadAdapter(Generic ServerRuntime.class,new
 NullProgressMonitor());
 
 HashMap props = new HashMap();
 props.put("mappernames", "");
 props.put("classPathVariableName", "JONAS");
 props.put("serverAddress", "127.0.0.1");
 props.put("jonasBase", "C:\\JOnAS-4.1.4");
 props.put("jonasRoot", "C:\\JOnAS-4.1.4");
 props.put("classPath", "C:\\JOnAS-4.1.4");
 props.put("protocols", "C:\\JOnAS-4.1.4");
 props.put("port", "9000");
 runtimeDelegate.setServerInstanceProperties(props);
 
 //Save the runtime working copy
 runtimeWorkingCopy.save(false,null);
 
 --
 Gorkem
 
 
 Mark Berner wrote:
 > How can I can add JBoss runtime configuration from plugin.
 >
 > Code below creates Runtime configuration, but it does not set add JBoss
 > root location. As I understand that I should send property
 > "serverRootDirectory" to configuration bu I didn't way how.
 >
 > I will very appreciate for any help
 > Mark
 >
 >
 > IServerType serverTypeJBoss4 = ServerCore
 > findServerType("org.eclipse.jst.server.generic.jboss4");
 > if (serverTypeJBoss4 != null)
 > {
 > IRuntimeType runtimeType = serverTypeJBoss4.getRuntimeType();
 > if (runtimeType != null)
 > {
 >    IRuntimeWorkingCopy runtimeWorkingCopy = runtimeType.createRuntime(
 >        "jboss.runtime", monitor);
 >
 >  runtimeWorkingCopy.setLocation(newPath(jbossHomeDir.getCanon icalPath()));
 >     runtimeWorkingCopy.save(true, monitor);
 >  }
 > }
 >
 |  |  |  | 
|  | 
|  | 
|  | 
Powered by 
FUDForum. Page generated in 0.05975 seconds