Oracle Fusion Middleware
Java API Reference for Oracle PDK Java
11g Release 1 (11.1.1)
E10691-01

oracle.portal.provider.v2
Class ProviderLoader

java.lang.Object
  extended by oracle.portal.provider.v2.ProviderLoader
Direct Known Subclasses:
DefaultProviderLoader

public abstract class ProviderLoader
extends java.lang.Object

In its simplest terms, a ProviderLoader can be thought of as a 'factory' for ProviderInstance objects: the objects that actually carry out the functionality of a single registered provider instance. However, given that a ProviderInstance is generally driven from meta-data in a ProviderDefinition, which should be shared by other ProviderInstances of the same 'type', it is also the responsibility of a ProviderLoader to initialize and cache an up-to-date version of the ProviderDefinition and associate this with the instances it creates.

Generally, a ProviderLoader will initialize a ProviderDefinition from meta data held in a persistent store, e.g. XML file or database. To allow changes to the persisted data to be picked up while the provider is in operation, a ProviderLoader is allowed to replace its cached ProviderDefinition with a new version under certain circumstances. A flag is provided to suppress this behaviour, however, so that the ProviderInstance and the Portal it is registered on do not get 'out of sync' with respect to their picture of the provider.

Because this mechanism is kept external to the ProviderDefinition itself, it gives scope for the same provider to be backed by a different storage medium without having to change its implementation.


Constructor Summary
ProviderLoader()
           
 
Method Summary
abstract  ProviderContext getProviderContext()
          Gets the context object that describes the deployment environment of the provider type handled by this ProviderLoader.
 ProviderInstance getProviderInstance(java.lang.String providerId)
          Gets a ProviderInstance object with the specified providerId without permitting reload of the cached ProviderDefinition.
abstract  ProviderInstance getProviderInstance(java.lang.String providerId, boolean refresh)
          Gets a ProviderInstance object with the specified providerId, optionally permitting reload of the cached ProviderDefinition.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProviderLoader

public ProviderLoader()
Method Detail

getProviderInstance

public ProviderInstance getProviderInstance(java.lang.String providerId)
                                     throws ProviderException
Gets a ProviderInstance object with the specified providerId without permitting reload of the cached ProviderDefinition.

This is provided as a shorthand for calling getProviderInstance(providerId, false).

Parameters:
providerId - the providerId of the ProviderInstance that is being requested
Returns:
the ProviderInstance object with the specified providerId
Throws:
ProviderException

getProviderInstance

public abstract ProviderInstance getProviderInstance(java.lang.String providerId,
                                                     boolean refresh)
                                              throws ProviderException
Gets a ProviderInstance object with the specified providerId, optionally permitting reload of the cached ProviderDefinition.

The first time this method is called, a new ProviderDefinition should be loaded from its meta data and cached internally. This same cached ProviderDefinition must be associated with all ProviderInstances returned by this method, unless it is called again when the refresh flag is true. In this case, the method is allowed to replace the cached ProviderDefinition with a new version, e.g. if its meta data has been changed.

Parameters:
providerId - the providerId of the ProviderInstance that is being requested
refresh - flag indicating whether the ProviderDefinition should be reloaded or not. A value of true will cause a refresh.
Returns:
the ProviderInstance object with the specified providerId
Throws:
ProviderException

getProviderContext

public abstract ProviderContext getProviderContext()
Gets the context object that describes the deployment environment of the provider type handled by this ProviderLoader.

Returns:
context object describing the deployment environment of the provider.

Oracle Fusion Middleware
Java API Reference for Oracle PDK Java
11g Release 1 (11.1.1)
E10691-01

Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.