org.eclipse.equinox.p2.core.IProvisioningAgentProvider Java Examples

The following examples show how to use org.eclipse.equinox.p2.core.IProvisioningAgentProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Activator.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void start ( final BundleContext context ) throws Exception
{
    this.context = context;
    this.tracker = new ServiceTracker<IProvisioningAgentProvider, IProvisioningAgentProvider> ( context, IProvisioningAgentProvider.class, null );
    this.tracker.open ();
    Activator.INSTANCE = this;
}
 
Example #2
Source File: Activator.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
public static IProvisioningAgent getAgent ( final URI location ) throws ProvisionException
{
    final IProvisioningAgentProvider provider = INSTANCE.tracker.getService ();
    if ( provider == null )
    {
        throw new IllegalStateException ( "Provisioning agent provider not found. Is P2 started?" );
    }

    return provider.createAgent ( location );
}
 
Example #3
Source File: Activator.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void start ( final BundleContext context ) throws Exception
{
    this.context = context;
    this.tracker = new ServiceTracker<IProvisioningAgentProvider, IProvisioningAgentProvider> ( context, IProvisioningAgentProvider.class, null );
    this.tracker.open ();
    Activator.INSTANCE = this;
}
 
Example #4
Source File: Activator.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
public static IProvisioningAgent getAgent ( final URI location ) throws ProvisionException
{
    final IProvisioningAgentProvider provider = INSTANCE.tracker.getService ();
    if ( provider == null )
    {
        throw new IllegalStateException ( "Provisioning agent provider not found. Is P2 started?" );
    }

    return provider.createAgent ( location );
}
 
Example #5
Source File: ProvisioningAgentProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@SuppressWarnings({ "rawtypes", "unchecked" })
public IProvisioningAgent get() throws ProvisionException {
	ServiceReference sr = getContext().getServiceReference(IProvisioningAgentProvider.SERVICE_NAME);
	if (sr == null) {
		throw new ProvisionException("No service reference found for " + IProvisioningAgentProvider.SERVICE_NAME);
	}
	IProvisioningAgentProvider agentProvider = (IProvisioningAgentProvider) getContext().getService(sr);
	return agentProvider.createAgent(null);
}