|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.enterprise.server.plugin.pc.content.ContentProviderManager
public class ContentProviderManager
Responsible for managing ContentProvider implementations. These implementations
come from the content plugins themselves.
| Constructor Summary | |
|---|---|
ContentProviderManager()
|
|
| Method Summary | |
|---|---|
protected void |
createInitialAdaptersMap()
This is protected so only the plugin container and subclasses can use it. |
java.util.Set<ContentSource> |
getAllContentSources()
Returns a set of all content sources whose adapters are managed by this object. |
ContentProvider |
getIsolatedContentProvider(int contentProviderId)
Given a ID to a content source, this returns the adapter that is responsible for communicating with that content source where that adapter object will ensure invocations on it are isolated to its plugin classloader. |
protected ContentProvider |
getIsolatedContentSourceAdapter(ContentSource contentSource)
This returns the adapter that is responsible for communicating with the given content source where that adaptor object will ensure invocations on it are isolated to its plugin classloader. |
protected void |
initialize(ContentServerPluginManager pluginManager)
Tells this manager to initialize itself which will initialize all the adapters. |
java.io.InputStream |
loadDistributionFileBits(int contentSourceId,
java.lang.String location)
Asks that the adapter responsible for the given content source return a stream to the DistributionFile bits for the DistributionFile at the given location. |
java.io.InputStream |
loadPackageBits(int contentSourceId,
java.lang.String location)
Asks that the adapter responsible for the given content source return a stream to the package bits for the package at the given location. |
void |
restartAdapter(ContentSource contentSource)
Convienence method that simply shuts down the adapter and then
restarts it. |
protected void |
shutdown()
Tells this manager to shutdown. |
void |
shutdownAdapter(ContentSource contentSource)
Call this method when a content source is removed from the system during runtime or if you just want to shutdown the adapter for whatever reason. |
void |
startAdapter(ContentSource contentSource)
Call this method when a new content source is added to the system during runtime. |
boolean |
synchronizeContentSource(int contentSourceId)
Asks the provider responsible for the given content source to synchronize with its remote repository. |
boolean |
testConnection(int contentSourceId)
Tests the connection to the content source that has the given ID. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContentProviderManager()
| Method Detail |
|---|
public java.io.InputStream loadPackageBits(int contentSourceId,
java.lang.String location)
throws java.lang.Exception
contentSourceId - the adapter for this content source will be used to stream the bitslocation - where the adapter can find the package bits on the content source
java.lang.Exception - if the adapter failed to load the bits
public java.io.InputStream loadDistributionFileBits(int contentSourceId,
java.lang.String location)
throws java.lang.Exception
contentSourceId - the adapter for this content source will be used to stream the bitslocation - where the adapter can find the DistributionFile bits on the content source
java.lang.Exception - if the adapter failed to load the bits
public boolean synchronizeContentSource(int contentSourceId)
throws java.lang.Exception
false (in effect, will let the currently running synchronization continue; we try not to step on
it). If this method does actually do a sync, true will be returned.
contentSourceId - identifies the database entry of the provider
true if the synchronization completed; false if there was already a
synchronization happening and this method aborted
java.lang.Exception
public boolean testConnection(int contentSourceId)
throws java.lang.Exception
contentSourceId -
true if there is an adapter that can successfully connect to the given content source
false if there is an adapter but it cannot successfully connect
java.lang.Exception - if failed to get an adapter to attempt the connectionpublic java.util.Set<ContentSource> getAllContentSources()
public void startAdapter(ContentSource contentSource)
throws InitializationException
shutdown.
If there is already an adapter currently started for the given content source, this returns silently.
contentSource - the new content source that was added
InitializationException - if the provider throws an error on its startuppublic void shutdownAdapter(ContentSource contentSource)
startAdapter(ContentSource).
If there are no adapters currently started for the given content source, this returns silently.
contentSource - the content source being deleted
public void restartAdapter(ContentSource contentSource)
throws java.lang.Exception
shuts down the adapter and then
restarts it. Call this when, for example, a content source's
configuration has changed.
contentSource - the content source whose adapter is to be restarted
java.lang.Exception - if there is an error asking the provider to shutdown or startprotected void initialize(ContentServerPluginManager pluginManager)
This is protected so only the plugin container and subclasses can use it.
pluginManager - the plugin manager this object can use to obtain information from (like classloaders)
InitializationException - if any of the providers throw an error on startupprotected void shutdown()
This is protected so only the plugin container and subclasses can use it.
protected void createInitialAdaptersMap()
public ContentProvider getIsolatedContentProvider(int contentProviderId)
throws java.lang.RuntimeException
contentProviderId - an ID to a ContentSource
java.lang.RuntimeException - if there is no content source with the given ID
protected ContentProvider getIsolatedContentSourceAdapter(ContentSource contentSource)
throws java.lang.RuntimeException
contentSource - the returned adapter communicates with this content source
java.lang.RuntimeException - if there is no content source adapter available
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||