org.jacorb.orb.etf

Class ProfileBase

public abstract class ProfileBase extends _ProfileLocalBase implements Cloneable, Configurable

Version: $Id: ProfileBase.java,v 1.6 2007/02/14 09:07:23 andre.spiegel Exp $

Author: Andre Spiegel

Field Summary
protected TaggedComponentListcomponents
protected Configurationconfiguration
protected StringcorbalocStr
protected byte[]objectKey
protected Versionversion
Method Summary
voidaddComponent(int tag, Object data, Class helper)
voidaddComponent(int tag, byte[] data)
TaggedProfileasTaggedProfile()
Profilecopy()
This function shall return an equivalent, deep-copy of the profile on the free store.
voiddemarshal(TaggedProfileHolder tagged_profile, TaggedComponentSeqHolder components)
Method to mirror the marshal method.
shortencapsulation()
Indicates the encapsulation that will be used by this profile when encoding its AddressProfile bytes, and which should subsequently be used when marshalling all the rest of the TaggedProfile.profile_data.
ObjectgetComponent(int tag, Class helper)
TaggedComponentListgetComponents()
Accessor for the TaggedComponents of the Profile.
byte[]get_object_key()
ETF defined operation to get the object key from this profile.
protected voidinitFromProfileData(byte[] data)
Used from the byte[] constructor and the demarshal method.
voidmarshal(TaggedProfileHolder tagged_profile, TaggedComponentSeqHolder componentSequence)
ETF defined function to marshal the appropriate information for this transport into the tagged profile.
voidpatchPrimaryAddress(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 voidreadAddressProfile(CDRInputStream stream)
Read the ETF::AddressProfile from the supplied stream.
voidset_object_key(byte[] key)
ETF defined operation to set the object key on this profile.
abstract inttag()
ETF defined read-only accessor for the GIOP tag.
Versionversion()
ETF defined read-only accessor for the GIOP version.
abstract voidwriteAddressProfile(CDROutputStream stream)
Write the AddressProfile to the supplied stream.

Field Detail

components

protected TaggedComponentList components

configuration

protected Configuration configuration

corbalocStr

protected String corbalocStr

objectKey

protected byte[] objectKey

version

protected Version version

Method Detail

addComponent

public void addComponent(int tag, Object data, 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.

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 its 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.

getComponent

public Object getComponent(int tag, Class helper)

getComponents

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

get_object_key

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

initFromProfileData

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

marshal

public void marshal(TaggedProfileHolder tagged_profile, TaggedComponentSeqHolder componentSequence)
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.

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.

readAddressProfile

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

set_object_key

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

tag

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

version

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

writeAddressProfile

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