uk.ac.soton.itinnovation.grid.utils
Class ResourceTypeRegistry

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.utils.ResourceTypeRegistry

public class ResourceTypeRegistry
extends Object

Maps PBAC resource types to client-side Java interfaces.

See Also:
GridClientPluginProvider

Constructor Summary
ResourceTypeRegistry()
           
 
Method Summary
static QName[] getKnownPortTypes()
          List all registered port types.
static Class<? extends StorableInStateRepository>[] getRegisteredResourceTypes()
          Gets the current registered resources
static String lookupResourceType(Class<? extends StorableInStateRepository> klass)
          Finds the first resource type for a given class.
static Class<?> lookupResourceType(String resourceType)
          Find the interface for a remote resource with this type.
static Class<? extends RemoteService> lookupService(QName portType)
          Find the RemoteService interface for a service with this port type.
static Class<? extends RemoteService> lookupService(String portTypeString)
           
static QName lookupServiceType(Class<? extends RemoteService> klass)
          Deprecated. - this just calls lookupResourceType(java.lang.String)
static void registerPortType(QName portType, Class<? extends RemoteService> remoteService)
          Add a new port type to the list of known types.
static void registerResourceType(String resourceType, Class<?> resourceIface)
          Add a new resource type to the list of known types.
static void registerServiceType(Class<? extends RemoteService> remoteService)
          Register the portTypeName defined for this interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceTypeRegistry

public ResourceTypeRegistry()
Method Detail

getRegisteredResourceTypes

public static Class<? extends StorableInStateRepository>[] getRegisteredResourceTypes()
Gets the current registered resources


registerResourceType

public static void registerResourceType(String resourceType,
                                        Class<?> resourceIface)
Add a new resource type to the list of known types. This is used by plug-ins to register new types.


lookupResourceType

public static Class<?> lookupResourceType(String resourceType)
Find the interface for a remote resource with this type.

Parameters:
resourceType - the resource type
Returns:
an interface for the remote service
See Also:
ConversationID.getResourceType(org.apache.axis.message.addressing.EndpointReferenceType)

lookupResourceType

public static String lookupResourceType(Class<? extends StorableInStateRepository> klass)
Finds the first resource type for a given class. Used to convert old EndpointReferenceTypes that have just a Java type to a service type

Parameters:
klass -
Returns:
a resource type

lookupServiceType

public static QName lookupServiceType(Class<? extends RemoteService> klass)
Deprecated. - this just calls lookupResourceType(java.lang.String)

Finds the first service QName for a given class. Used to convert old EndpointReferenceTypes that have just a Java type to a service type

Parameters:
klass -
Returns:
a resource type

registerServiceType

public static void registerServiceType(Class<? extends RemoteService> remoteService)
Register the portTypeName defined for this interface.


registerPortType

public static void registerPortType(QName portType,
                                    Class<? extends RemoteService> remoteService)
Add a new port type to the list of known types. This is used by plug-ins to register new service types.

See Also:
registerServiceType(java.lang.Class)

lookupService

public static Class<? extends RemoteService> lookupService(QName portType)
Find the RemoteService interface for a service with this port type.

Parameters:
portType - the port type in the WSDL
Returns:
an interface for the remote service, or null if unknown
Throws:
ClassCastException - if the interface found does not extend RemoteService

lookupService

public static Class<? extends RemoteService> lookupService(String portTypeString)

getKnownPortTypes

public static QName[] getKnownPortTypes()
List all registered port types.



Copyright © 2001-2008 University of Southampton IT Innovation Centre. All Rights Reserved.