org.jboss.dna.repository
Class SimpleRepositoryContext

java.lang.Object
  extended by org.jboss.dna.repository.SimpleRepositoryContext
All Implemented Interfaces:
RepositoryContext

@Immutable
public class SimpleRepositoryContext
extends Object
implements RepositoryContext

A simple, immutable RepositoryContext implementation that uses the references supplied as parameters to the constructor.


Constructor Summary
SimpleRepositoryContext(ExecutionContext context, Observer observer, RepositoryConnectionFactory connectionFactory)
           
 
Method Summary
 Subgraph getConfiguration(int depth)
          Get a snapshot of the current configuration for the RepositorySource.
 ExecutionContext getExecutionContext()
          Get the execution context, which can be used to create other contexts with specific JAAS security contexts.
 Observer getObserver()
          Get the observer that the connector may use to publish changes.
 RepositoryConnectionFactory getRepositoryConnectionFactory()
          Get the factory for connections to other sources.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleRepositoryContext

public SimpleRepositoryContext(ExecutionContext context,
                               Observer observer,
                               RepositoryConnectionFactory connectionFactory)
Method Detail

getConfiguration

public Subgraph getConfiguration(int depth)
Get a snapshot of the current configuration for the RepositorySource. The root of the subgraph will be the node in the configuration that represents the RepositorySource.

Specified by:
getConfiguration in interface RepositoryContext
Parameters:
depth - the max depth of the configuration subgraph
Returns:
the configuration snapshot as a subgraph, or null if there is no configuration
See Also:
RepositoryContext.getConfiguration(int)

getExecutionContext

public ExecutionContext getExecutionContext()
Get the execution context, which can be used to create other contexts with specific JAAS security contexts.

Specified by:
getExecutionContext in interface RepositoryContext
Returns:
the execution context; never null
See Also:
RepositoryContext.getExecutionContext()

getObserver

public Observer getObserver()
Get the observer that the connector may use to publish changes.

Specified by:
getObserver in interface RepositoryContext
Returns:
the observer, or null if the are no listeners and publishing is not required/requested
See Also:
RepositoryContext.getObserver()

getRepositoryConnectionFactory

public RepositoryConnectionFactory getRepositoryConnectionFactory()
Get the factory for connections to other sources.

Specified by:
getRepositoryConnectionFactory in interface RepositoryContext
Returns:
the connection factory
See Also:
RepositoryContext.getRepositoryConnectionFactory()


Copyright © 2008-2009 JBoss, a division of Red Hat. All Rights Reserved.