com.sap.netweaver.bc.serialize

Class Registrator

java.lang.Object
  extended by com.sap.netweaver.bc.serialize.Registrator
All Implemented Interfaces:
ISerializerRegistrator, IComponentListener

public final class Registrator
extends Object
implements ISerializerRegistrator, IComponentListener

Copyright 2004 SAP AG


Nested Class Summary
static class Registrator.ShutdownListener
           
 
Nested classes/interfaces inherited from interface com.sap.netweaver.bc.serialize.ISerializerRegistrator
ISerializerRegistrator.PropertyUsage
 
Field Summary
 
Fields inherited from interface com.sap.netweaver.bc.serialize.ISerializerRegistrator
APPLICATION_PROPERTIES, RESOURCE_PROPERTIES
 
Method Summary
 void claim(IClaimStaker claimstaker)
          iterates over all repositories available and calls the claim(IClaimStaker, RID) for each of the repositories prefixes.
 void claim(IClaimStaker claimstaker, RID prefix)
          adds the claims of the given claimstaker to the list of claimed properties.
 void deregister(ISerializer serializer)
          deregisters a serializer for all repositories it has been registered for.
 boolean deregister(ISerializer serializer, RID prefix)
           
 PropertiesClaim getClaim(RID rid, ISerializerRegistrator.PropertyUsage usage)
           
static ISerializerRegistrator getInstance()
           
 Registrator.ShutdownListener getListener()
          backdoor-method for hot-reload functionality.
 EntryList list(RID rid)
           
 void notify(ComponentEvent event)
          A component was added, reconfigured or will be removed.
 void register(ISerializer serializer, boolean isCore)
           
 void register(ISerializer serializer, IRepositoryManager manager, boolean isCore)
          the same method as register(ISerializer, RID, boolean), but uses the IRepositoryManager.getPrefix() method to calculate the RID
 void register(ISerializer serializer, RID prefix, boolean isCore)
          expects the RID to start with the RID.PATH_SEPARATOR
 void register(ISerializer serializer, RID prefix, boolean isCore, int position)
          expects the RID to start with the RID.PATH_SEPARATOR
 RID[] registeredRIDs()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static ISerializerRegistrator getInstance()

register

public void register(ISerializer serializer,
                     RID prefix,
                     boolean isCore)
              throws SerializationException
expects the RID to start with the RID.PATH_SEPARATOR

Specified by:
register in interface ISerializerRegistrator
Parameters:
serializer - to register for the given prefix, must not be null
prefix - the RID to register the transportable for, must not be null
isCore - flag to tell if the whole serialization process has to be cancelled, if this serializer fails. Use this flag with care. It should be only used for services that are relevant for security or the actual content of the resource
Throws:
SerializationException

register

public void register(ISerializer serializer,
                     IRepositoryManager manager,
                     boolean isCore)
              throws SerializationException
Description copied from interface: ISerializerRegistrator
the same method as register(ISerializer, RID, boolean), but uses the IRepositoryManager.getPrefix() method to calculate the RID

Specified by:
register in interface ISerializerRegistrator
Throws:
SerializationException

register

public void register(ISerializer serializer,
                     RID prefix,
                     boolean isCore,
                     int position)
              throws SerializationException
expects the RID to start with the RID.PATH_SEPARATOR

Specified by:
register in interface ISerializerRegistrator
Parameters:
serializer - to register for the given prefix, must not be null
prefix - the RID to register the transportable for, must not be null
isCore - flag to tell if the whole serialization process has to be cancelled, if this serializer fails. Use this flag with care. It should be only used for services that are relevant for security or the actual content of the resource
position - an explicit position in the calling sequence for serializers. Note that an implementation of this interface may not use this inofrmation. Also, there is no guarantee that other serializers will be active for the given RID.
Throws:
SerializationException

deregister

public boolean deregister(ISerializer serializer,
                          RID prefix)
                   throws SerializationException
Specified by:
deregister in interface ISerializerRegistrator
Parameters:
serializer - the transportable to deregister, must not be null
prefix - the prefix to deregister the transportable for, must not be null
Returns:
if the given transportable has not been registered, the method will return false, it will return true otherwise
Throws:
SerializationException

list

public EntryList list(RID rid)
Specified by:
list in interface ISerializerRegistrator
Parameters:
rid - the RID to retrieve all transportables for, must not be null
Returns:
a list of the registered transportables for the given RID, might be empty but must not be null. A modification of the array by the calling class must not modify the registration of transportables within this registrator

registeredRIDs

public RID[] registeredRIDs()
Specified by:
registeredRIDs in interface ISerializerRegistrator
Returns:
all RID s that ISerializer instances have been defined for. Might return an empty array, but never null.

getListener

public Registrator.ShutdownListener getListener()
backdoor-method for hot-reload functionality.

Returns:
the one and only listener for this registrator

register

public void register(ISerializer serializer,
                     boolean isCore)
              throws SerializationException
Specified by:
register in interface ISerializerRegistrator
Parameters:
serializer - to register for all repositories available, must not be null
isCore - flag to tell if the whole serialization process has to be cancelled, if this serializer fails. Use this flag with care. It should be only used for services that are relevant for security or the actual content of the resource
Throws:
SerializationException

deregister

public void deregister(ISerializer serializer)
                throws SerializationException
Description copied from interface: ISerializerRegistrator
deregisters a serializer for all repositories it has been registered for.

Specified by:
deregister in interface ISerializerRegistrator
Parameters:
serializer - the serializer to deregister, must not be null
Throws:
SerializationException

claim

public void claim(IClaimStaker claimstaker,
                  RID prefix)
Description copied from interface: ISerializerRegistrator
adds the claims of the given claimstaker to the list of claimed properties. As the name claim already suggests, this is by no means binding for any other claimstaker. Each implementing class is free to ignore claims made by other claimstakers. If in doubt, the class can check for claimed IPropertyName instances by calling the getClaims(RID rid) method. Note possible race-conditions if another class added claims in between the two method calls.

Specified by:
claim in interface ISerializerRegistrator
Parameters:
claimstaker - the class that wants to claim exclusive ownership of certain IPropertyName while serialization of a resource. Must not be null
prefix - the prefix of the repository to claim ownership of the properties for.

claim

public void claim(IClaimStaker claimstaker)
           throws ResourceException
Description copied from interface: ISerializerRegistrator
iterates over all repositories available and calls the claim(IClaimStaker, RID) for each of the repositories prefixes.

Specified by:
claim in interface ISerializerRegistrator
Throws:
ResourceException - if the ResourceFactory cannot retrieve the collection of IRepositoryManager instances.

getClaim

public PropertiesClaim getClaim(RID rid,
                                ISerializerRegistrator.PropertyUsage usage)
Specified by:
getClaim in interface ISerializerRegistrator
Parameters:
rid - RID of the resource to get the properties claim for. Must not be null
Returns:
the aggregated claim of all claims done up to this point in time. A calling class must never hold a reference of this object for longer than a method call, as this aggregation might become outdated.

notify

public void notify(ComponentEvent event)
Description copied from interface: IComponentListener
A component was added, reconfigured or will be removed.

Specified by:
notify in interface IComponentListener
Parameters:
event - the component event
See Also:
ComponentEvent.Type
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2014 SAP AG Complete Copyright Notice