IBM Branch Transformation Toolkit Javadoc

com.ibm.dse.base
Class ServiceExternalizer

java.lang.Object
  extended bycom.ibm.dse.base.Externalizer
      extended bycom.ibm.dse.base.ServiceExternalizer
All Implemented Interfaces:
Cache

public class ServiceExternalizer
extends Externalizer


Field Summary
 
Fields inherited from class com.ibm.dse.base.Externalizer
numberOfObjects, tagClassTable, tagInputStream, TYPE_CONTEXT, TYPE_DATA, TYPE_FORMAT, TYPE_OPERATION, TYPE_PROCESSOR, TYPE_SERVICE, TYPE_SETTINGS, TYPE_TYPE, TYPE_UNKNOWN, TYPE_VIEW
 
Constructor Summary
ServiceExternalizer()
          ServiceExternalizer default constructor.
ServiceExternalizer(java.lang.String option, java.io.BufferedInputStream aIniStream)
          This constructor initializes an Externalizer object.
ServiceExternalizer(java.lang.String option, java.lang.String pathAndFile)
          This constructor initializes an Externalizer object.
 
Method Summary
 java.lang.Object convertTagToObject(Tag aTag)
          Converts a tag to an object and initializes the object's attributes.
protected  Externalizer createNewExternalizer()
          Returns a new externalizer for the generic service file.
 void end()
          Releases resources from this externalizer.
 void makeTagClassTable()
          Creates a tagClassTable with the values in the DSE.INI file (path is settings.tags.services).
 void reset()
          Sets a new service externalizer to Service.
 void reset(java.util.Enumeration listTagId)
          Resets the definition of tags whose tag id appears in listTagId.
 void reset(java.lang.String tagId)
          Resets the definition of the tag with id tagId.
protected  void reset(java.lang.String tagId, TagInputStream aTagInputStream)
          Resets the definition of the service entity with id equals to tagId.
 
Methods inherited from class com.ibm.dse.base.Externalizer
addEntryInTagClassTable, clearCacheTable, getCachePolicyToApply, getCacheTable, getClasses, getFromCacheTable, getNumberOfObjects, getObjectsMaxNum, getObjectsPerTypeMaxNum, getObjectTypesMaxNum, getTagClassTable, getTagInputStream, getTagOutputStream, isCachingEnabled, isRunTime, putIntoCacheTable, readObject, readObject, readTag, rebuildCacheTable, setCachingEnabled, setNumberOfObjects, setObjectsMaxNum, setObjectsPerTypeMaxNum, setObjectTypesMaxNum, setRunTime, setTagClassTable, setTagInputStream, tagList, tagWithId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceExternalizer

public ServiceExternalizer()
ServiceExternalizer default constructor.


ServiceExternalizer

public ServiceExternalizer(java.lang.String option,
                           java.io.BufferedInputStream aIniStream)
                    throws java.io.IOException
This constructor initializes an Externalizer object. The option parameter should be Memory" or File. Memory indicates that all tags are to be stored in memory. This is the recommended option for small tag files. File indicates that the tag file is read each time a tag is needed. This is the recommended option for large tag files.

Parameters:
option - java.lang.String
aIniStream - java.io.BufferedInputStream containing the input data

ServiceExternalizer

public ServiceExternalizer(java.lang.String option,
                           java.lang.String pathAndFile)
                    throws java.io.IOException
This constructor initializes an Externalizer object. The option parameter should be Memory or File. Memory indicates that all tags are to be stored in memory. This is the recommended option for small tag files. File indicates that the tag file is read each time a tag is needed. This is the recommended option for large tag files.

Parameters:
option - java.lang.String
pathAndFile - java.lang.String specifying the name and path of the formats definition file
Method Detail

convertTagToObject

public java.lang.Object convertTagToObject(Tag aTag)
                                    throws java.io.IOException
Converts a tag to an object and initializes the object's attributes. Users can specify where to find the service using the full package name in the operations tag, in the initialization file, or using an implClass. To work properly, the class that provides the instance must have a constructor with no arguments.

Overrides:
convertTagToObject in class Externalizer
Parameters:
aTag - Tag
Returns:
Object
Throws:
java.io.IOException

createNewExternalizer

protected Externalizer createNewExternalizer()
                                      throws java.io.IOException,
                                             DSEObjectNotFoundException
Returns a new externalizer for the generic service file.

Returns:
com.ibm.dse.base.Externalizer
Throws:
java.io.IOException
DSEObjectNotFoundException

end

public void end()
Releases resources from this externalizer.

Specified by:
end in class Externalizer

makeTagClassTable

public void makeTagClassTable()
Creates a tagClassTable with the values in the DSE.INI file (path is settings.tags.services).

Overrides:
makeTagClassTable in class Externalizer

reset

public void reset()
           throws java.io.IOException,
                  DSEObjectNotFoundException
Sets a new service externalizer to Service.

Throws:
java.io.IOException
DSEObjectNotFoundException

reset

public void reset(java.lang.String tagId)
           throws java.io.IOException,
                  DSEObjectNotFoundException
Resets the definition of the tag with id tagId. The new definition is read from the file associated with this externalizer. If the tag doesn't exist in the file but exists in memory then memory definition is deleted. If the tag doesn't exist in the file nor in memory, then an exception is thrown. If the tag exists in the file but doesn't exist in memory, then the new definition is added to memory. If the tag exists both in the file and in memory, then the memory definition is updated with the file definition.

Parameters:
tagId - java.lang.String - The id of the tag to reset
Throws:
java.io.IOException
DSEObjectNotFoundException

reset

protected void reset(java.lang.String tagId,
                     TagInputStream aTagInputStream)
              throws java.io.IOException
Resets the definition of the service entity with id equals to tagId. The new definition is obtained from the TagInputStream passed by parameter. If the tag doesn't exist in the TagInputStream, but exists in memory, then memory definition is deleted. If the tag doesn't exist neither in the TagInputStream nor in memory, then an exception is thrown. If the tag exists in the TagInputStream but doesn't exist in memory, then the new definition is added to memory. If the tag exists both in the TagInputStream and in memory, then the memory definition is updated with the TagInputStream definition.

Parameters:
tagId - java.lang.String
aTagInputStream - com.ibm.dse.base.TagInputStream
Throws:
java.io.IOException

reset

public void reset(java.util.Enumeration listTagId)
           throws java.io.IOException,
                  DSEObjectNotFoundException
Resets the definition of tags whose tag id appears in listTagId. The new definition are read from the file associated with this externalizer. If the tag doesn't exist in the file but exists in memory, then memory definition is deleted. If the tag doesn't exist in the file nor in memory, then an exception is thrown. If the tag exists in the file but doesn't exist in memory, then the new definition is added to memory. If the tag exists both in the file and in memory, then the memory definition is updated with the file definition.

Parameters:
listTagId - java.util.Enumeration
Throws:
java.io.IOException
DSEObjectNotFoundException

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005