org.jacorb.orb.etf
Class ProfileBase

java.lang.Object
  extended byorg.omg.CORBA.LocalObject
      extended byorg.omg.ETF._ProfileLocalBase
          extended byorg.jacorb.orb.etf.ProfileBase
All Implemented Interfaces:
java.lang.Cloneable, org.apache.avalon.framework.configuration.Configurable, IDLEntity, LocalInterface, Object, Profile, ProfileOperations, java.io.Serializable
Direct Known Subclasses:
IIOPProfile

public abstract class ProfileBase
extends _ProfileLocalBase
implements java.lang.Cloneable, org.apache.avalon.framework.configuration.Configurable

Version:
$Id: ProfileBase.java,v 1.2 2005/09/27 20:49:11 phil.mesnier Exp $
Author:
Andre Spiegel
See Also:
Serialized Form

Field Summary
protected  TaggedComponentList components
           
protected  org.jacorb.config.Configuration configuration
           
protected  java.lang.String corbalocStr
           
protected  byte[] objectKey
           
protected  Version version
           
 
Constructor Summary
ProfileBase()
           
 
Method Summary
 void addComponent(int tag, byte[] data)
           
 void addComponent(int tag, java.lang.Object data, java.lang.Class helper)
           
 TaggedProfile asTaggedProfile()
           
 Profile copy()
          This function shall return an equivalent, deep-copy of the profile on the free store.
 void demarshal(TaggedProfileHolder tagged_profile, TaggedComponentSeqHolder components)
          Method to mirror the marshal method.
 short encapsulation()
          Indicates the encapsulation that will be used by this profile when encoding it's AddressProfile bytes, and which should subsequently be used when marshalling all the rest of the TaggedProfile.profile_data.
 byte[] get_object_key()
          ETF defined operation to get the object key from this profile.
 java.lang.Object getComponent(int tag, java.lang.Class helper)
           
 TaggedComponentList getComponents()
          Accessor for the TaggedComponents of the Profile.
protected  void initFromProfileData(byte[] data)
          Used from the byte[] constructor and the demarshal method.
 void marshal(TaggedProfileHolder tagged_profile, TaggedComponentSeqHolder components)
          ETF defined function to marshal the appropriate information for this transport into the tagged profile.
 void patchPrimaryAddress(ProtocolAddressBase replacement)
          Profiles use this method for taking alternative address values for replacement, such as when an IOR proxy or IMR is in use.
abstract  void readAddressProfile(CDRInputStream stream)
          Read the ETF::AddressProfile from the supplied stream.
 void set_object_key(byte[] key)
          ETF defined operation to set the object key on this profile.
abstract  int tag()
          ETF defined read-only accessor for the GIOP tag.
 Version version()
          ETF defined read-only accessor for the GIOP version.
abstract  void writeAddressProfile(CDROutputStream stream)
          Write the AddressProfile to the supplied stream.
 
Methods inherited from class org.omg.ETF._ProfileLocalBase
_ids
 
Methods inherited from class org.omg.CORBA.LocalObject
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_interface, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.avalon.framework.configuration.Configurable
configure
 
Methods inherited from interface org.omg.ETF.ProfileOperations
hash, is_match
 
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_interface, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
 

Field Detail

version

protected Version version

objectKey

protected byte[] objectKey

components

protected TaggedComponentList components

configuration

protected org.jacorb.config.Configuration configuration

corbalocStr

protected java.lang.String corbalocStr
Constructor Detail

ProfileBase

public ProfileBase()
Method Detail

set_object_key

public void set_object_key(byte[] key)
ETF defined operation to set the object key on this profile.

Specified by:
set_object_key in interface ProfileOperations

get_object_key

public byte[] get_object_key()
ETF defined operation to get the object key from this profile.

Specified by:
get_object_key in interface ProfileOperations

version

public Version version()
ETF defined read-only accessor for the GIOP version.

Specified by:
version in interface ProfileOperations

tag

public abstract int tag()
ETF defined read-only accessor for the GIOP tag.

Specified by:
tag in interface ProfileOperations

patchPrimaryAddress

public void patchPrimaryAddress(ProtocolAddressBase replacement)
Profiles use this method for taking alternative address values for replacement, such as when an IOR proxy or IMR is in use. This is a concrete method here to not break existing profiles that may not be interested in this behavior.


marshal

public void marshal(TaggedProfileHolder tagged_profile,
                    TaggedComponentSeqHolder components)
ETF defined function to marshal the appropriate information for this transport into the tagged profile. ORBs will typically need to call the IOR interception points before calling marshal().

This particular implementation *should* work for any IOP type protocol that encodes its profile_data as a CDR encapsulated octet array as long as you have correctly implemented the encapsulation(), #writeAddressProfile(), and #readAddressProfile() methods. But, feel free to override it for the purpose of optimisation or whatever. It should however, remain consistent with your implementation of the above mentioned methods.

Specified by:
marshal in interface ProfileOperations

demarshal

public void demarshal(TaggedProfileHolder tagged_profile,
                      TaggedComponentSeqHolder components)
Method to mirror the marshal method.


encapsulation

public short encapsulation()
Indicates the encapsulation that will be used by this profile when encoding it's AddressProfile bytes, and which should subsequently be used when marshalling all the rest of the TaggedProfile.profile_data. Using the default CDROutputStream for a transport profile encapsulation this should always be 0.


writeAddressProfile

public abstract void writeAddressProfile(CDROutputStream stream)
Write the AddressProfile to the supplied stream. Implementors can assume an encapsulation is already open.


readAddressProfile

public abstract void readAddressProfile(CDRInputStream stream)
Read the ETF::AddressProfile from the supplied stream.


getComponents

public TaggedComponentList getComponents()
Accessor for the TaggedComponents of the Profile.


getComponent

public java.lang.Object getComponent(int tag,
                                     java.lang.Class helper)

addComponent

public void addComponent(int tag,
                         java.lang.Object data,
                         java.lang.Class helper)

addComponent

public void addComponent(int tag,
                         byte[] data)

asTaggedProfile

public TaggedProfile asTaggedProfile()

copy

public Profile copy()
This function shall return an equivalent, deep-copy of the profile on the free store.

Specified by:
copy in interface ProfileOperations

initFromProfileData

protected void initFromProfileData(byte[] data)
Used from the byte[] constructor and the demarshal method. Relies on subclasses having satisfactorily implemented the #readAddressProfile() method.