org.electrocodeogram.cpc.core.api.provider.registry
Interface IProviderDescriptor

All Superinterfaces:
java.lang.Comparable<IProviderDescriptor>

public interface IProviderDescriptor
extends java.lang.Comparable<IProviderDescriptor>

API interface for the descriptors used to handle lazy loaded IProvider instances in an IProviderRegistry implementation.

Given an IProviderDescriptor an instance of the corresponding provider can be obtained by calling IProviderRegistry.lookupProvider(IProviderDescriptor).

Author:
vw
See Also:
IProviderRegistry, IProvider

Method Summary
 java.lang.String getName()
          A human readable name for this provider.
 byte getPriority()
          The priority of this provider.
 java.lang.String getProviderClass()
          The implementing class for this provider.
 java.lang.String getTypeClass()
          The API interface which this provider implements.
 boolean isSingleton()
          Whether this provider is a singleton or whether a new instance is created for each lookup.
 void setName(java.lang.String name)
          Sets a human readable name for this provider.
 void setPriority(byte priority)
          Sets the priority of this provider.
 void setProviderClass(java.lang.String providerClass)
          Sets the implementing class for this provider.
 void setSingleton(boolean singleton)
          Specifies whether this provider is a singleton or whether a new instance is created for each lookup.
 void setTypeClass(java.lang.String typeClass)
          Sets the API interface which this provider implements.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getName

java.lang.String getName()
A human readable name for this provider.

Returns:
name of this provider, never null.

setName

void setName(java.lang.String name)
Sets a human readable name for this provider.

See Also:
getName()

getPriority

byte getPriority()
The priority of this provider. The higher, the more likely it is to be used.
The priority of the default implementations is 0.

Returns:
priority of this provider, may be negative.

setPriority

void setPriority(byte priority)
Sets the priority of this provider.

See Also:
getPriority()

getTypeClass

java.lang.String getTypeClass()
The API interface which this provider implements.
This must be the fully qualified name of an IProvider sub-interface.

Returns:
FQN of IProvider API interface which is implemented by this provider, never null.

setTypeClass

void setTypeClass(java.lang.String typeClass)
Sets the API interface which this provider implements.

See Also:
getTypeClass()

getProviderClass

java.lang.String getProviderClass()
The implementing class for this provider.
This must be the fully qualified name of a class which implements the getTypeClass() interface.

CAUTION: do not use this value to try to obtain an instance of this provider yourself. All instances need to be retrieved via the corresponding IProviderRegistry methods.

Returns:
FQN of the implementing class for this provider, never null.

setProviderClass

void setProviderClass(java.lang.String providerClass)
Sets the implementing class for this provider.

See Also:
getProviderClass()

isSingleton

boolean isSingleton()
Whether this provider is a singleton or whether a new instance is created for each lookup.

Most providers are singletons for performance reasons.

Returns:
true if this provider is a singleton, false otherwise.

setSingleton

void setSingleton(boolean singleton)
Specifies whether this provider is a singleton or whether a new instance is created for each lookup.

See Also:
isSingleton()