org.eclipse.corona.container.manager
Class ProjectContainerProxy

java.lang.Object
  extended by org.eclipse.corona.container.manager.ProjectContainerProxy
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener, IContainerManager, IProjectContainerManager

public class ProjectContainerProxy
extends java.lang.Object
implements IProjectContainerManager, java.beans.PropertyChangeListener


Field Summary
(package private) static ProjectContainerProxy instance
           
(package private)  IProjectContainerManager localProjectContainerManager
           
 
Method Summary
 void addListener(java.beans.PropertyChangeListener l)
          Method adds listener which listens whether refresh method on project container was called.
 void addRelatedContainerUri(java.lang.String containerUri, java.lang.String relatedContainerUri)
          Add a containerUri String to the list of related Containers in specified ContextContainer
 void close()
          Close the ContainerManager.
 void closeContainer(java.lang.String containerUri)
          Close the ContextContainer (however, a reference count of Container users is kept so it may not "really" close.
 void closeProjectContainerForMember(java.lang.String containerUri, java.lang.String memberName)
          Close an existing project container on behalf of a project team member.
 void configure(IContainerConfiguration config)
          Not sure how configuration of the ContainerManager is really going to work.
 java.lang.String getHomeIdentifier()
          return the uri of the ContainerManager, Container manager is a singleton
static ProjectContainerProxy getInstance()
           
 java.util.Map getNameToContainerUriMap()
          Provides a mapping from Container Name to Container Uri uses information from ContainerConfigurations so Containers do not have to be opened.
 java.lang.Object getService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration registration)
           
 java.util.Map getUriToContainerNameMap()
          Provides a mapping from Container Uri to Container Name uses information from ContainerConfigurations so Containers do not have to be opened.
(package private)  void initialize()
           
 void joinProject(java.lang.String containerUri, IRepositoryResource memberObject)
          Add a member to the ProjectContextContainer's Team Member Repository.
 java.util.List listActiveMembers(java.lang.String containerUri)
          Returns a List of Strings containing Team Member names that currently have this ProjectContextContainer open.
 java.util.List listAllRelatedContainerUris(ContextContainer startContainer)
          Get a list of all containers directly and indirectly related to this container.
 java.util.List listAllRelatedContainerUris(java.lang.String startContainer)
          Get a list of all containers directly and indirectly related to this container.
 java.util.List listContainerUris()
           
 java.util.List listOpenContainers()
           
 java.util.List listOpenContainersWithRepository(java.lang.String repositoryName)
          Find a list of ProjectContextContainer names which contain a RepositoryDescriptor with the given name
 java.util.List listRelatedContainerUris(ContextContainer container)
          Get a list of the containers list as related to this container.
 java.util.List listRelatedContainerUris(java.lang.String containerUri)
          Get a list of the containers list as related to this container.
 IContainerConfiguration loadConfiguration(java.lang.String containerPath)
          Load the configuration for this ContextContainer
 ContextContainer openContainer(java.lang.String containerUri)
          Open an existing ContextContainer,
 ProjectContextContainer openProjectContainer(java.lang.String containerUri)
           
 ProjectContextContainer openProjectContainerForMember(java.lang.String containerUri, java.lang.String memberName)
          Opens an existing project container on behalf of a project team member.
 void propertyChange(java.beans.PropertyChangeEvent event)
          Object is informed about changes in configuration.
 void refresh()
          Method refreshs the manager context.
 void removeListener(java.beans.PropertyChangeListener l)
          Method removes listener refresh method listener.
 void removeRelatedContainerUri(java.lang.String containerUri, java.lang.String relatedContainerUri)
          Remove a containerUri String from the list of related Containers in specified ContextContainer
 java.lang.Object resolveContainer(java.lang.String containerUri, IContainerConfiguration config)
          Finds an existing Container if none exists with specified containerUri a new one is created.
 void saveContainer(java.lang.String containerName)
          serializes the ContextContainer object to disk location specified in the ContainerConfiguration
 void ungetService(org.osgi.framework.Bundle bundle, org.osgi.framework.ServiceRegistration registration, java.lang.Object service)
           
 void unjoinProject(java.lang.String containerUri, java.lang.String memberName)
          remove a member from the ProjectContextContainer's Team Member Repository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

localProjectContainerManager

IProjectContainerManager localProjectContainerManager

instance

static ProjectContainerProxy instance
Method Detail

getInstance

public static ProjectContainerProxy getInstance()

initialize

void initialize()

joinProject

public void joinProject(java.lang.String containerUri,
                        IRepositoryResource memberObject)
Description copied from interface: IProjectContainerManager
Add a member to the ProjectContextContainer's Team Member Repository. The member is not active until member opens the ProjectContextContainerForMember

Specified by:
joinProject in interface IProjectContainerManager
memberObject - Team member object to add to the Team Member Repository the repository must know how to handle this type of object
See Also:
org.eclipse.corona.container.project.manage.IProjectContainerManager#openProjectContainerForMember(String, String)

openProjectContainerForMember

public ProjectContextContainer openProjectContainerForMember(java.lang.String containerUri,
                                                             java.lang.String memberName)
                                                      throws NoTeamRepositoryException
Description copied from interface: IProjectContainerManager
Opens an existing project container on behalf of a project team member. The team member should have already joined the project

Specified by:
openProjectContainerForMember in interface IProjectContainerManager
Parameters:
containerUri - uri identifying the ProjectContextContainer
memberName - the unique memberId for a TeamMember in the TeamMember Repository
Returns:
ProjectContextContainer object
Throws:
NoTeamRepositoryException
See Also:
An event is sent to notify others using the ProjectContextContainer that this member has the ProjectContextContainer opened

unjoinProject

public void unjoinProject(java.lang.String containerUri,
                          java.lang.String memberName)
Description copied from interface: IProjectContainerManager
remove a member from the ProjectContextContainer's Team Member Repository

Specified by:
unjoinProject in interface IProjectContainerManager
Parameters:
containerUri - uri of PrjectContextContainer holding Team Member Repository to remove the Team Member from from
memberName - the unique Team member Id to remove from the Team Member Repository

addRelatedContainerUri

public void addRelatedContainerUri(java.lang.String containerUri,
                                   java.lang.String relatedContainerUri)
Description copied from interface: IContainerManager
Add a containerUri String to the list of related Containers in specified ContextContainer

Specified by:
addRelatedContainerUri in interface IContainerManager
Parameters:
containerUri - uri used to uniquely identify the ContextContainer
relatedContainerUri - uri used to uniquely identify the related ContextContainer

close

public void close()
Description copied from interface: IContainerManager
Close the ContainerManager. This method is called when the container manager is being closed and no longer needed. It provides the opportunity for the container manager to clean-up and close its resources.

Specified by:
close in interface IContainerManager

closeContainer

public void closeContainer(java.lang.String containerUri)
Description copied from interface: IContainerManager
Close the ContextContainer (however, a reference count of Container users is kept so it may not "really" close.

Specified by:
closeContainer in interface IContainerManager
Parameters:
containerUri - uri used to uniquely identify the ContextContainer

configure

public void configure(IContainerConfiguration config)
Description copied from interface: IContainerManager
Not sure how configuration of the ContainerManager is really going to work.

Specified by:
configure in interface IContainerManager

getHomeIdentifier

public java.lang.String getHomeIdentifier()
Description copied from interface: IContainerManager
return the uri of the ContainerManager, Container manager is a singleton

Specified by:
getHomeIdentifier in interface IContainerManager
Returns:
uri of the ContainerManager

getNameToContainerUriMap

public java.util.Map getNameToContainerUriMap()
Description copied from interface: IContainerManager
Provides a mapping from Container Name to Container Uri uses information from ContainerConfigurations so Containers do not have to be opened.

Specified by:
getNameToContainerUriMap in interface IContainerManager
Returns:
map of Container Name String to Container Uri String

getService

public java.lang.Object getService(org.osgi.framework.Bundle bundle,
                                   org.osgi.framework.ServiceRegistration registration)
Specified by:
getService in interface IContainerManager
Returns:

listAllRelatedContainerUris

public java.util.List listAllRelatedContainerUris(java.lang.String startContainer)
Description copied from interface: IContainerManager
Get a list of all containers directly and indirectly related to this container. This list includes all referenced containers it "chases" all the related containers but the list will not contain duplicate containers

Specified by:
listAllRelatedContainerUris in interface IContainerManager
Returns:
List of containerUri Strings of ALL related and indirectly related Containers duplicates are not included in the list.

listAllRelatedContainerUris

public java.util.List listAllRelatedContainerUris(ContextContainer startContainer)
Description copied from interface: IContainerManager
Get a list of all containers directly and indirectly related to this container. This list includes all referenced containers it "chases" all the related containers but the list will not contain duplicate containers

Specified by:
listAllRelatedContainerUris in interface IContainerManager
Parameters:
startContainer - uri used to uniquely identify the ContextContainer to start finding related containers from.
Returns:
List of containerUri Strings of ALL related and indirectly related Containers duplicates are not included in the list.

listContainerUris

public java.util.List listContainerUris()
Specified by:
listContainerUris in interface IContainerManager
Returns:

listOpenContainers

public java.util.List listOpenContainers()
Specified by:
listOpenContainers in interface IContainerManager
Returns:

listRelatedContainerUris

public java.util.List listRelatedContainerUris(java.lang.String containerUri)
Description copied from interface: IContainerManager
Get a list of the containers list as related to this container. This list includes only directly referenced containers it does not "chase" related related containers.

Specified by:
listRelatedContainerUris in interface IContainerManager
Parameters:
containerUri - uri used to uniquely identify the ContextContainer
Returns:
List of String of related Containers' uris

listRelatedContainerUris

public java.util.List listRelatedContainerUris(ContextContainer container)
Description copied from interface: IContainerManager
Get a list of the containers list as related to this container. This list includes only directly referenced containers it does not "chase" related related containers.

Specified by:
listRelatedContainerUris in interface IContainerManager
Parameters:
container - ContextContainer object
Returns:
List of String of related Containers' uris

loadConfiguration

public IContainerConfiguration loadConfiguration(java.lang.String containerPath)
Description copied from interface: IContainerManager
Load the configuration for this ContextContainer

Specified by:
loadConfiguration in interface IContainerManager
Parameters:
containerPath - uri used to uniquely identify the ContextContainer
Returns:
the ContainerConfiguration object

openContainer

public ContextContainer openContainer(java.lang.String containerUri)
Description copied from interface: IContainerManager
Open an existing ContextContainer,

Specified by:
openContainer in interface IContainerManager
Parameters:
containerUri - uri used to uniquely identify the ContextContainer
Returns:
ContextContainer object

openProjectContainer

public ProjectContextContainer openProjectContainer(java.lang.String containerUri)
Parameters:
containerUri -
Returns:

removeRelatedContainerUri

public void removeRelatedContainerUri(java.lang.String containerUri,
                                      java.lang.String relatedContainerUri)
Description copied from interface: IContainerManager
Remove a containerUri String from the list of related Containers in specified ContextContainer

Specified by:
removeRelatedContainerUri in interface IContainerManager
Parameters:
containerUri - uri used to uniquely identify the ContextContainer
relatedContainerUri - uri used to uniquely identify the related ContextContainer

resolveContainer

public java.lang.Object resolveContainer(java.lang.String containerUri,
                                         IContainerConfiguration config)
Description copied from interface: IContainerManager
Finds an existing Container if none exists with specified containerUri a new one is created. If containerConfig is is null a new containerConfig is created and written

Specified by:
resolveContainer in interface IContainerManager
Parameters:
containerUri - uri used to uniquely identify the ContextContainer
config - the configuration object for this this type of Container
Returns:

saveContainer

public void saveContainer(java.lang.String containerName)
Description copied from interface: IContainerManager
serializes the ContextContainer object to disk location specified in the ContainerConfiguration

Specified by:
saveContainer in interface IContainerManager
Parameters:
containerName - uri used to uniquely identify the ContextContainer

ungetService

public void ungetService(org.osgi.framework.Bundle bundle,
                         org.osgi.framework.ServiceRegistration registration,
                         java.lang.Object service)
Specified by:
ungetService in interface IContainerManager

getUriToContainerNameMap

public java.util.Map getUriToContainerNameMap()
Description copied from interface: IContainerManager
Provides a mapping from Container Uri to Container Name uses information from ContainerConfigurations so Containers do not have to be opened.

Specified by:
getUriToContainerNameMap in interface IContainerManager
Returns:
map of Container Uri String to Container Name String

closeProjectContainerForMember

public void closeProjectContainerForMember(java.lang.String containerUri,
                                           java.lang.String memberName)
Description copied from interface: IProjectContainerManager
Close an existing project container on behalf of a project team member. The team member should have already joined the project

Specified by:
closeProjectContainerForMember in interface IProjectContainerManager
See Also:
An event is sent to notify others using the ProjectContextContainer that this member has closed the ProjectContextContainer.

listActiveMembers

public java.util.List listActiveMembers(java.lang.String containerUri)
Description copied from interface: IProjectContainerManager
Returns a List of Strings containing Team Member names that currently have this ProjectContextContainer open.

Specified by:
listActiveMembers in interface IProjectContainerManager
Parameters:
containerUri - uri of container to check for active Team Members
Returns:
list of Strings containing Team Member names

listOpenContainersWithRepository

public java.util.List listOpenContainersWithRepository(java.lang.String repositoryName)
Description copied from interface: IContainerManager
Find a list of ProjectContextContainer names which contain a RepositoryDescriptor with the given name

Specified by:
listOpenContainersWithRepository in interface IContainerManager
Parameters:
repositoryName - the name of the repository to search for in the open ProjectContextContainers
Returns:
a list of Strings of ProjectContextContainer Names which hold a RepositoryDescriptor with the name repositoryName

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Object is informed about changes in configuration.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
event - informing event.

refresh

public void refresh()
Method refreshs the manager context. Usually called when corona configuration directory changes.

Specified by:
refresh in interface IProjectContainerManager

addListener

public void addListener(java.beans.PropertyChangeListener l)
Method adds listener which listens whether refresh method on project container was called.

Parameters:
l - listener.

removeListener

public void removeListener(java.beans.PropertyChangeListener l)
Method removes listener refresh method listener.

Parameters:
l - listener.

Copyright 2006 IBM Corporation and others.
All Rights Reserved.