| java.lang.Object com.sun.portal.community.mc.CMCFactory
CMCFactory | public class CMCFactory (Code) | | Returns instances of CommunityUser
and CommunityNode objects.
The community MC (membership and configuration)
system is implemented using the
group of responsibility (GoR) pattern. This is a variation on the
chain of responsibility (CoR) pattern. CoR defines an ordered
set of "handlers", each with the same interface.
Clients have a reference to a head handler,
and make calls into its interface.
To answer question and perform operations,
the handler can either return a response,
or defer to the next handler (successor) to answer the question.
Clients do not know which handler answered the question,
only that it was answered.
Applying the GoR pattern to this class,
there is a set of unordered
contributors, and one manager,
all of which implement the same interface.
This class returns references to the manager,
which has references to the contributors. Clients call into the manager,
and the manager delegates to one or more of the contributors to
answer the question.
Clients are unaware of the pattern.
They only see the CommunityNode or
CommunityUser interface.
This class is configured via a properties file,
communitymc.properties. This file must
exist on the classpath. communitymc.properties contains
configuration for this factory,
the manager implementation, and all contributor implementations.
The properties are
read from the classpath by this class, and passed to the manager,
which passes it to
each contributor upon initialization.
This class requires the communitymc.properties file to contain the
property manager.package
that defines the Java package name where the manager
CommunityUserImpl and
CommunityNodeImpl classes can be found. For example:
manager.package=com.sun.portal.community.impl.manager
See Also: com.sun.portal.community.mc.CommunityUser See Also: com.sun.portal.community.mc.CommunityNode |
Field Summary | |
final public static String | NODE_CLASS_NAME The relative class name that implements the CommunityNode interface. | final public static String | NODE_MANAGER_CLASS_NAME The relative class name that implements the
CommunityNodeManager interface. | final public static String | USER_CLASS_NAME The relative class name that implements the CommunityUser interface. |
NODE_CLASS_NAME | final public static String NODE_CLASS_NAME(Code) | | The relative class name that implements the CommunityNode interface.
Community C+M contributor implementations must include a class with this name under the package name of
the contributor specified in the community properties file. For example, for a contributor named foo,
the community properties file must specify a property foo.package that
indicates the package name of the
class CommunityNodeImpl that implements the foo community node contributor, as such:
foo.package=some.pkg
Accordingly, the Java class some.pkg.CommunityNodeImpl must be present and
implement the CommunityNode interface.
|
NODE_MANAGER_CLASS_NAME | final public static String NODE_MANAGER_CLASS_NAME(Code) | | The relative class name that implements the
CommunityNodeManager interface.
Community MC contributor implementations must include a class with
this name under the package name of
the contributor specified in the community properties file.
For example, for a contributor named foo,
the community properties file must specify a property
foo.package that
indicates the package name of the
class CommunityNodeManagerImpl that implements the foo
community node contributor, as such:
foo.package=some.pkg
Accordingly, the Java class
some.pkg.CommunityNodeManagerImpl must be present and
implement the CommunityNodeManager interface.
|
USER_CLASS_NAME | final public static String USER_CLASS_NAME(Code) | | The relative class name that implements the CommunityUser interface.
Community C+M contributor implementations must include a class with this relative name under the package name of
the contributor specified in the community properties file. For example, for a contributor named foo,
the community properties file must specify a property foo.package that
indicates the package name of the
class CommunityUserImpl that implements the foo community user contributor, as such:
foo.package=some.pkg
Accordingly, the Java class some.pkg.CommunityUserImpl must be present and
implement the CommunityUser interface.
|
getCMCNode | public CMCNode getCMCNode(CMCPrincipal communityPrincipal) throws CMCException(Code) | | Get a CommunityNode object.
This method never returns null. The return value of this method has no
bearing on whether the community node exists persistently. To verify
existence, clients should call exists() on the
CommunityNode after obtaining
a refernece via this method. Community nodes are created by calling
create() on the CommunityNode .
Community nodes are removed by
calling remove() on the CommunityNode .
A CommunityNode object corresponding to the CommunityPrincipal parameter. Parameters: communityPrincipal - The CommunityPrincipal that identifies the CommunityNode throws: com.sun.portal.community.mc.CommunityException - If there was a problem obtaining the community node object for the given community principal parameter See Also: com.sun.portal.community.mc.CommunityNode.create |
getCMCUser | public CMCUser getCMCUser(String userId) throws CMCException(Code) | | Get a CommunityUser object.
The resulting CommunityUser manager
object will load all configured CommunityUser
contributor types.
Parameters: userId - The user identifier that identified the CommunityUser object A CommunityUser object corresponding to the given user ID parameter. throws: com.sun.portal.community.mc.CommunityException - If there was a problem obtaing the CommunityUser object |
getCMCUser | public CMCUser getCMCUser(String userId, Iterator types) throws CMCException(Code) | | Get a CommunityUser object.
The resulting CommunityUser manager
object will load only the named CommunityUser
contributor types. The named contributors must be a subset
of the configured contributors.
A CommunityUser object corresponding to the given user ID parameter. Parameters: types - A Set of Strings , the contributor types to load. Parameters: userId - The user identifier that identified the CommunityUser object throws: com.sun.portal.community.mc.CommunityException - If there was a problem obtaing the CommunityUser object |
getInstance | public static CMCFactory getInstance() throws CMCException(Code) | | Get a community factory instance.
CommunityFactory is a singleton. Instances of this class may only be obtained through this method.
throws: com.sun.portal.community.mc.CommunityException - If there is a problem obtaining the factory instance. the factory object. |
|
|