public void stop() { if (agentRef != null) { Activator.getContext().ungetService(agentRef); agentRef = null; } }
@Override public void stop() { if (agentRef != null) { Activator.getContext().ungetService(agentRef); agentRef = null; } }
public void stop() { if (agentRef != null) { Activator.getContext().ungetService(agentRef); agentRef = null; } }
public void stop() { if (agentRef != null) { Activator.getContext().ungetService(agentRef); agentRef = null; } }
private void setupAgent() throws ProvisionException { agentRef = Activator.getContext().getServiceReference(IProvisioningAgent.class); if (agentRef != null) { agent = Activator.getContext().getService(agentRef); if (agent != null) return; } ServiceReference<IProvisioningAgentProvider> providerRef = Activator.getContext().getServiceReference(IProvisioningAgentProvider.class); if (providerRef == null) throw new RuntimeException("No provisioning agent provider is available"); //$NON-NLS-1$ IProvisioningAgentProvider provider = Activator.getContext().getService(providerRef); if (provider == null) throw new RuntimeException("No provisioning agent provider is available"); //$NON-NLS-1$ //obtain agent for currently running system agent = provider.createAgent(null); Activator.getContext().ungetService(providerRef); }
private void setupAgent() throws ProvisionException { agentRef = Activator.getContext().getServiceReference(IProvisioningAgent.class); if (agentRef != null) { agent = Activator.getContext().getService(agentRef); if (agent != null) return; } ServiceReference<IProvisioningAgentProvider> providerRef = Activator.getContext().getServiceReference(IProvisioningAgentProvider.class); if (providerRef == null) throw new RuntimeException("No provisioning agent provider is available"); //$NON-NLS-1$ IProvisioningAgentProvider provider = Activator.getContext().getService(providerRef); if (provider == null) throw new RuntimeException("No provisioning agent provider is available"); //$NON-NLS-1$ //obtain agent for currently running system agent = provider.createAgent(null); Activator.getContext().ungetService(providerRef); }
private void setupAgent() throws ProvisionException { agentRef = Activator.getContext().getServiceReference(IProvisioningAgent.class); if (agentRef != null) { agent = Activator.getContext().getService(agentRef); if (agent != null) return; } ServiceReference<IProvisioningAgentProvider> providerRef = Activator.getContext().getServiceReference(IProvisioningAgentProvider.class); if (providerRef == null) throw new RuntimeException("No provisioning agent provider is available"); //$NON-NLS-1$ IProvisioningAgentProvider provider = Activator.getContext().getService(providerRef); if (provider == null) throw new RuntimeException("No provisioning agent provider is available"); //$NON-NLS-1$ //obtain agent for currently running system agent = provider.createAgent(null); Activator.getContext().ungetService(providerRef); }
private void setupAgent() throws ProvisionException { agentRef = Activator.getContext().getServiceReference(IProvisioningAgent.class); if (agentRef != null) { agent = Activator.getContext().getService(agentRef); if (agent != null) return; } ServiceReference<IProvisioningAgentProvider> providerRef = Activator.getContext().getServiceReference(IProvisioningAgentProvider.class); if (providerRef == null) throw new RuntimeException("No provisioning agent provider is available"); //$NON-NLS-1$ IProvisioningAgentProvider provider = Activator.getContext().getService(providerRef); if (provider == null) throw new RuntimeException("No provisioning agent provider is available"); //$NON-NLS-1$ //obtain agent for currently running system agent = provider.createAgent(null); Activator.getContext().ungetService(providerRef); }
private void initialize(IPublisherInfo publisherInfo) { this.info = publisherInfo; if (jreLocation != null) { File javaProfile = null; if (jreLocation.isDirectory()) { //Look for a JRE profile file to set version and capabilities File[] profiles = jreLocation.listFiles(new FileFilter() { public boolean accept(File pathname) { return pathname.getAbsolutePath().endsWith(".profile"); //$NON-NLS-1$ } }); if (profiles != null && profiles.length > 0) { javaProfile = profiles[0]; } } else if (jreLocation.isFile()) javaProfile = jreLocation; else // jreLocation file does not exist throw new IllegalArgumentException(NLS.bind(Messages.exception_nonExistingJreLocationFile, jreLocation.getAbsolutePath())); profileProperties = loadProfile(javaProfile); } if (profileProperties == null) { String entry = environment != null ? "/profiles/" + environment.replace('/', '_') + ".profile" : DEFAULT_PROFILE; //$NON-NLS-1$ //$NON-NLS-2$ URL profileURL = Activator.getContext().getBundle().getEntry(entry); profileProperties = loadProfile(profileURL); } }
protected Object launchApplication(Map<String, Object> applicationMap) { String applicationId = (String) applicationMap.get(APP_ID); String filter = "(service.pid=" + applicationId + ")"; //$NON-NLS-1$//$NON-NLS-2$ ApplicationDescriptor descriptor = (ApplicationDescriptor) ServiceHelper.getService(Activator.getContext(), ApplicationDescriptor.class.getName(), filter); try { ApplicationHandle handle = descriptor.launch(applicationMap); return handle.getExitValue(0); } catch (ApplicationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; }
protected Object launchApplication(Map<String, Object> applicationMap) { String applicationId = (String) applicationMap.get(APP_ID); String filter = "(service.pid=" + applicationId + ")"; //$NON-NLS-1$//$NON-NLS-2$ ApplicationDescriptor descriptor = ServiceHelper.getService(Activator.getContext(), ApplicationDescriptor.class, filter); try { ApplicationHandle handle = descriptor.launch(applicationMap); return handle.getExitValue(0); } catch (ApplicationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; }
protected Object launchApplication(Map<String, Object> applicationMap) { String applicationId = (String) applicationMap.get(APP_ID); String filter = "(service.pid=" + applicationId + ")"; //$NON-NLS-1$//$NON-NLS-2$ ApplicationDescriptor descriptor = ServiceHelper.getService(Activator.getContext(), ApplicationDescriptor.class, filter); try { ApplicationHandle handle = descriptor.launch(applicationMap); return handle.getExitValue(0); } catch (ApplicationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; }