PTP
Release 5.0

org.eclipse.ptp.remote.core
Class PTPRemoteCorePlugin

java.lang.Object
  extended by org.eclipse.core.runtime.Plugin
      extended by org.eclipse.ptp.remote.core.PTPRemoteCorePlugin
All Implemented Interfaces:
BundleActivator

public class PTPRemoteCorePlugin
extends org.eclipse.core.runtime.Plugin

The activator class controls the plug-in life cycle


Field Summary
static String REMOTE_SERVICES_EXTENSION_POINT_ID
           
 
Fields inherited from class org.eclipse.core.runtime.Plugin
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
 
Constructor Summary
PTPRemoteCorePlugin()
          The constructor
 
Method Summary
static Object getAdapter(Object sourceObject, Class adapterType)
          If it is possible to adapt the given object to the given type, this returns the adapter.
 IRemoteServices[] getAllRemoteServices()
          Retrieve a sorted list of remote services.
 IRemoteServices[] getAllRemoteServices(org.eclipse.core.runtime.IProgressMonitor monitor)
          Retrieve a sorted list of remote services.
static PTPRemoteCorePlugin getDefault()
          Returns the shared instance
 IRemoteServices getDefaultServices()
          Retrieve the default remote services plugin.
 IRemoteServices getRemoteServices(String id)
          Get the remote services implementation identified by id.
 IRemoteServices getRemoteServices(String id, org.eclipse.core.runtime.IProgressMonitor monitor)
          Get the remote services implementation identified by id and ensure that it is initialized.
 IRemoteServices getRemoteServices(URI uri)
          Get the remote services identified by a URI.
 IRemoteServices getRemoteServices(URI uri, org.eclipse.core.runtime.IProgressMonitor monitor)
          Get the remote services implementation identified by URI and ensure that it is initialized.
 IRemoteServicesDescriptor getRemoteServicesDescriptor(String id)
          Get the remote services descriptor identified by id
static String getUniqueIdentifier()
          Get unique identifier for this plugin
static void log(org.eclipse.core.runtime.IStatus status)
          Logs the specified status with this plug-in's log.
static void log(String message)
          Logs an internal error with the specified message.
static void log(Throwable e)
          Logs an internal error with the specified throwable
 void start(BundleContext context)
           
 void stop(BundleContext context)
           
 
Methods inherited from class org.eclipse.core.runtime.Plugin
find, find, getBundle, getDescriptor, getLog, getPluginPreferences, getStateLocation, initializeDefaultPluginPreferences, internalInitializeDefaultPluginPreferences, isDebugging, openStream, openStream, savePluginPreferences, setDebugging, shutdown, startup, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REMOTE_SERVICES_EXTENSION_POINT_ID

public static final String REMOTE_SERVICES_EXTENSION_POINT_ID
Since:
4.0
See Also:
Constant Field Values
Constructor Detail

PTPRemoteCorePlugin

public PTPRemoteCorePlugin()
The constructor

Method Detail

getAdapter

public static Object getAdapter(Object sourceObject,
                                Class adapterType)
If it is possible to adapt the given object to the given type, this returns the adapter. Performs the following checks:
  1. Returns sourceObject if it is an instance of the adapter type.
  2. If sourceObject implements IAdaptable, it is queried for adapters.
  3. If sourceObject is not an instance of PlatformObject (which would have already done so), the adapter manager is queried for adapters
Otherwise returns null.

Parameters:
sourceObject - object to adapt, or null
adapterType - type to adapt to
Returns:
a representation of sourceObject that is assignable to the adapter type, or null if no such representation exists

getDefault

public static PTPRemoteCorePlugin getDefault()
Returns the shared instance

Returns:
the shared instance

getUniqueIdentifier

public static String getUniqueIdentifier()
Get unique identifier for this plugin


log

public static void log(org.eclipse.core.runtime.IStatus status)
Logs the specified status with this plug-in's log.

Parameters:
status - status to log

log

public static void log(String message)
Logs an internal error with the specified message.

Parameters:
message - the error message to log

log

public static void log(Throwable e)
Logs an internal error with the specified throwable

Parameters:
e - the exception to be logged

getAllRemoteServices

public IRemoteServices[] getAllRemoteServices()
Retrieve a sorted list of remote services. Note that these services are not initialized and clients must call IRemoteServices#initialized before they are used. Alternatively, use getAllRemoteServices(IProgressMonitor) to obtain all initialized services.

Returns:
remote services

getAllRemoteServices

public IRemoteServices[] getAllRemoteServices(org.eclipse.core.runtime.IProgressMonitor monitor)
Retrieve a sorted list of remote services. The remote services are guaranteed to have been initialized. Note that this will trigger plugin loading for all remote services implementations.

Returns:
remote services
Since:
5.0

getDefaultServices

public IRemoteServices getDefaultServices()
Retrieve the default remote services plugin. The default is the LocalServices provider, which is guaranteed to exist and be initialized.

Returns:
default remote services provider

getRemoteServices

public IRemoteServices getRemoteServices(String id)
Get the remote services implementation identified by id. The remote services retrieved may not have been initialized. IRemoteServices.initialize() must be called before any attempt is made to use the services.

Parameters:
id - id of the remote services
Returns:
remote services

getRemoteServices

public IRemoteServices getRemoteServices(String id,
                                         org.eclipse.core.runtime.IProgressMonitor monitor)
Get the remote services implementation identified by id and ensure that it is initialized. This method will present the user with a dialog box that can be canceled.

Parameters:
id - id of remote services to retrieve
monitor - progress monitor to allow user to cancel operation
Returns:
initialized remote services, or null if the services cannot be found or initialized
Since:
5.0

getRemoteServices

public IRemoteServices getRemoteServices(URI uri)
Get the remote services identified by a URI. The remote services retrieved may not have been initialized. IRemoteServices.initialize() must be called before any attempt is made to use the services.

Parameters:
uri - URI of remote services to retrieve
Returns:
remote services, or null if no corresponding services found

getRemoteServices

public IRemoteServices getRemoteServices(URI uri,
                                         org.eclipse.core.runtime.IProgressMonitor monitor)
Get the remote services implementation identified by URI and ensure that it is initialized. This method will present the user with a dialog box that can be canceled.

Parameters:
uri - URI of remote services to retrieve
monitor - progress monitor to allow user to cancel operation
Returns:
initialized remote services, or null if the services cannot be found or initialized
Since:
5.0

getRemoteServicesDescriptor

public IRemoteServicesDescriptor getRemoteServicesDescriptor(String id)
Get the remote services descriptor identified by id

Parameters:
id - id of the remote services
Returns:
remote services descriptor

start

public void start(BundleContext context)
           throws Exception
Specified by:
start in interface BundleActivator
Overrides:
start in class org.eclipse.core.runtime.Plugin
Throws:
Exception

stop

public void stop(BundleContext context)
          throws Exception
Specified by:
stop in interface BundleActivator
Overrides:
stop in class org.eclipse.core.runtime.Plugin
Throws:
Exception

PTP
Release 5.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.