public class SemanticObjectReferenceStore
extends com.streamscape.sef.dispatcher.AbstractRuntimeFactory
Title: Open Service Framework
Description: A factory for working with serialized configuration objects and their reference contexts.
This pseudo-transactional factory facilitates management of Reference Contexts and marshaling/unmarshaling of core configuration objects. Like the other MF factories it functions in a runtime context specific fashion, using the cache or the repository for its activities. Unlike standard factories this management interface provides a constructor that allows it to be instantiated prior to full initialization of the runtime, since this administrative interface is used during initialization and represents a pseudo-transactional data store.
This interface performs lookup and resolution operations against entities stored in the persistence cache.
The methods allow manipulation of object collections, instances and semantic type definitions. Although it
is possible to use the factory to obtain type references, the recommended way to do this is by using the
DatagramPrototypeCache
that is accessible from the RuntimeContext
.
Copyright: Copyright (c) 2010
Company: StreamScape Technologies
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_OBJECT |
static java.lang.String |
PROTOTYPE |
static java.lang.String |
SHOW_CONFIGURATION_PANEL |
DEFAULT_SERIAL_VERSION_ID
Constructor and Description |
---|
SemanticObjectReferenceStore(com.streamscape.repository.RepositoryContext repositoryContext)
A runtime constructor useful for initializing this factory with the current
runtime.
|
Modifier and Type | Method and Description |
---|---|
static void |
abortXact()
Aborts the pseudo-transaction, releasing all resources.
|
static void |
abortXactSafe()
Aborts the pseudo-transaction, releasing all resources.
|
static void |
beginXact()
Starts a pseudo-transaction for the calling thread.
|
static void |
beginXact(FabricComponent component)
Starts a pseudo-transaction for the calling thread.
|
static void |
bind(java.lang.String name,
java.lang.Object obj)
Binds the named object instance to the current active
ReferenceContext by serializing
the object as XML into the persistence store. |
static void |
commitXact()
Commits a pseudo-transaction and releases all resources held by the transaction.
|
static ReferenceContext |
createSubcontext(ReferenceContext parentContext,
java.lang.String subName)
Creates a reference context under an existing sub-context.
|
static ReferenceContext |
createSubcontextFromNamespace(java.lang.String ctxNamespace)
Creates a reference context from a Namespace string.
|
static void |
destroySubcontext(ReferenceContext refCtx)
Destroys a sub-context.
|
static boolean |
existsBinding(java.lang.String name)
Returns true if a specified name is bound to the current
Reference Context . |
static ReferenceContext |
getReferenceContext()
Returns the current reference context.
|
static ReferenceContext |
getRootContext()
Returns the root context (the top of the tree).
|
static boolean |
inXact()
Checks te state of the pseudo transaction.
|
static boolean |
inXactByCurrentThread()
Checks te state of the pseudo transaction initiated by the current thread.
|
static java.util.List |
listBoundNames(java.lang.String typeFilter)
Returns a list of names bound to the current context.
|
static java.util.List |
listSubcontexts()
Lists the sub-context of a particular context.
|
static java.lang.Object |
loadObject(ObjectPropertyValue scoParameterValue)
Loads an object specified by a
Service Configuration Property of type OBJECT
from the underlying configuration store. |
static java.lang.Object |
lookup(java.lang.String name)
Lookup the object in the underlying configuration store.
|
static ReferenceContext |
lookupReferenceContext(java.lang.String ctxNamespace)
Returns an instance of a
ReferenceContext based on the specified namespace if
it exists. |
static void |
moveObjectToJunk(java.lang.String objectName) |
static void |
rebind(java.lang.String name,
java.lang.Object obj)
Rebinds the named object to the same name.
|
static void |
rename(java.lang.String oldName,
java.lang.String newName)
Renames the binding to a different name.
|
static void |
setReferenceContext(ReferenceContext refCtx)
Sets the current reference context.
|
static void |
unbind(java.lang.String name)
Unbinds the referenced instance name from the repository.
|
getContextType, hasContext
clone, getSerialVersionUID
public static final java.lang.String PROTOTYPE
public static final java.lang.String SHOW_CONFIGURATION_PANEL
public static final java.lang.String DEFAULT_OBJECT
public SemanticObjectReferenceStore(com.streamscape.repository.RepositoryContext repositoryContext)
repositoryContext
- the Repository context.public static void beginXact() throws ObjectConfigurationException
ObjectConfigurationException
public static void beginXact(FabricComponent component) throws ObjectConfigurationException
ObjectConfigurationException
public static void commitXact() throws ObjectConfigurationException
ObjectConfigurationException
public static void abortXact()
public static void abortXactSafe()
public static boolean inXact()
ObjectConfigurationException
public static boolean inXactByCurrentThread()
ObjectConfigurationException
public static boolean existsBinding(java.lang.String name) throws ObjectConfigurationException
Reference Context
.
false
name
- StringObjectConfigurationException
public static void setReferenceContext(ReferenceContext refCtx) throws ObjectConfigurationException
true
refCtx
- ReferenceContextObjectConfigurationException
public static ReferenceContext getReferenceContext() throws ObjectConfigurationException
beginXact()
.
false
ObjectConfigurationException
public static ReferenceContext getRootContext() throws ObjectConfigurationException
false
ObjectConfigurationException
public static ReferenceContext createSubcontextFromNamespace(java.lang.String ctxNamespace) throws ObjectConfigurationException
true
ctxNamespace
- StringObjectConfigurationException
public static ReferenceContext createSubcontext(ReferenceContext parentContext, java.lang.String subName) throws ObjectConfigurationException
true
parentContext
- ReferenceContextsubName
- StringObjectConfigurationException
public static void destroySubcontext(ReferenceContext refCtx) throws ObjectConfigurationException
true
refCtx
- ReferenceContextObjectConfigurationException
public static java.util.List listBoundNames(java.lang.String typeFilter) throws ObjectConfigurationException
null
filter or an empty one indicates that no filtering is to be done.
true
typeFilter
- StringObjectConfigurationException
public static java.util.List listSubcontexts() throws ObjectConfigurationException
true
ObjectConfigurationException
public static java.lang.Object lookup(java.lang.String name) throws ObjectConfigurationException
true
name
- StringObjectConfigurationException
RuntimeContextException
public static ReferenceContext lookupReferenceContext(java.lang.String ctxNamespace) throws ObjectConfigurationException
ReferenceContext
based on the specified namespace if
it exists. Otherwise throws a NamingException
.
true
ctxNamespace
- String The name of the context or null
for initial root context.
If a '.' is specified this indicates the current context. If a '/'
is specified this is considered shorthand for the root context.javax.naming.NamingException
- if the name does not conform to a namespace format.RepositoryException
- - if a non-existent namespace is requested or a similar error occurs.ObjectConfigurationException
public static void bind(java.lang.String name, java.lang.Object obj) throws ObjectConfigurationException
ReferenceContext
by serializing
the object as XML into the persistence store. This method requires that the specific object be first
registered as a known Semantic Type
.
true
name
- Stringobj
- ObjectObjectConfigurationException
RuntimeContextException
public static void rebind(java.lang.String name, java.lang.Object obj) throws ObjectConfigurationException
true
name
- Stringobj
- ObjectObjectConfigurationException
RuntimeContextException
public static void rename(java.lang.String oldName, java.lang.String newName) throws ObjectConfigurationException
true
oldName
- StringnewName
- StringObjectConfigurationException
RuntimeContextException
public static void unbind(java.lang.String name) throws ObjectConfigurationException
true
name
- StringObjectConfigurationException
RuntimeContextException
public static java.lang.Object loadObject(ObjectPropertyValue scoParameterValue) throws ObjectConfigurationException
Service Configuration Property
of type OBJECT
from the underlying configuration store. The property holds a Reference Context as well
as Instance Name and Semantic Type of an object.
true
scoParameterValue
- OBJECTObjectConfigurationException
RuntimeContextException
public static void moveObjectToJunk(java.lang.String objectName) throws ObjectConfigurationException
ObjectConfigurationException
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.