APIdia Launch Partner
Top Description Fields Constructors Methods
javax.management.relation

public Class RelationTypeSupport

extends Object
implements RelationType
Class Inheritance
All Implemented Interfaces
javax.management.relation.RelationType, java.io.Serializable
Static Imports
com.sun.jmx.defaults.JmxProperties.RELATION_LOGGER, com.sun.jmx.mbeanserver.Util.cast

A RelationTypeSupport object implements the RelationType interface.

It represents a relation type, providing role information for each role expected to be supported in every relation of that type.

A relation type includes a relation type name and a list of role infos (represented by RoleInfo objects).

A relation type has to be declared in the Relation Service:

- either using the createRelationType() method, where a RelationTypeSupport object will be created and kept in the Relation Service

- either using the addRelationType() method where the user has to create an object implementing the RelationType interface, and this object will be used as representing a relation type in the Relation Service.

The serialVersionUID of this class is 4611072955724144607L.

Since
1.5

Field Summary

Modifier and TypeField and Description
private boolean
private Map<String, RoleInfo>
private static final ObjectStreamField[]
private static final long
private String

Constructor Summary

AccessConstructor and Description
public
RelationTypeSupport(String
Name of relation type
relationTypeName
,
RoleInfo[]
List of role definitions (RoleInfo objects)
roleInfoArray
)

Constructor where all role definitions are dynamically created and passed as parameter.

protected
RelationTypeSupport(String
Name of relation type.
relationTypeName
)

Constructor to be used for subclasses.

Method Summary

Modifier and TypeMethod and Description
protected void
addRoleInfo(RoleInfo
role info to be added.
roleInfo
)

Add a role info.

pack-priv static void
checkRoleInfos(RoleInfo[] roleInfoArray)

public String

Returns:

the relation type name.
getRelationTypeName
()

Implements javax.management.relation.RelationType.getRelationTypeName.

Returns the relation type name.

public RoleInfo

Returns:

RoleInfo object providing role definition does not exist
getRoleInfo
(String
role info name
roleInfoName
)

Implements javax.management.relation.RelationType.getRoleInfo.

Returns the role info (RoleInfo object) for the given role info name (null if not found).

public List<RoleInfo>
getRoleInfos()

Implements javax.management.relation.RelationType.getRoleInfos.

Returns the list of role definitions (ArrayList of RoleInfo objects).

private void
initMembers(String relationTypeName, RoleInfo[] roleInfoArray)

private void
pack-priv void
setRelationServiceFlag(boolean flag)

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

isInRelationServiceback to summary
private boolean isInRelationService
roleName2InfoMapback to summary
private Map<String, RoleInfo> roleName2InfoMap
serialPersistentFieldsback to summary
private static final ObjectStreamField[] serialPersistentFields
Serial Fields:
typeName:String
Relation type name
roleName2InfoMap:Map
Map holding the mapping: <role name (String)> -> <role info (RoleInfo object)>
isInRelationService:boolean
Flag specifying whether the relation type has been declared in the Relation Service (so can no longer be updated)
serialVersionUIDback to summary
private static final long serialVersionUID
typeNameback to summary
private String typeName

Constructor Detail

RelationTypeSupportback to summary
public RelationTypeSupport(String relationTypeName, RoleInfo[] roleInfoArray) throws IllegalArgumentException, InvalidRelationTypeException

Constructor where all role definitions are dynamically created and passed as parameter.

Parameters
relationTypeName:String

Name of relation type

roleInfoArray:RoleInfo[]

List of role definitions (RoleInfo objects)

Exceptions
IllegalArgumentException:
if null parameter
InvalidRelationTypeException:
if:

- the same name has been used for two different roles

- no role info provided

- one null role info provided

RelationTypeSupportback to summary
protected RelationTypeSupport(String relationTypeName)

Constructor to be used for subclasses.

Parameters
relationTypeName:String

Name of relation type.

Exceptions
IllegalArgumentException:
if null parameter.

Method Detail

addRoleInfoback to summary
protected void addRoleInfo(RoleInfo roleInfo) throws IllegalArgumentException, InvalidRelationTypeException

Add a role info. This method of course should not be used after the creation of the relation type, because updating it would invalidate that the relations created associated to that type still conform to it. Can throw a RuntimeException if trying to update a relation type declared in the Relation Service.

Parameters
roleInfo:RoleInfo

role info to be added.

Exceptions
IllegalArgumentException:
if null parameter.
InvalidRelationTypeException:
if there is already a role info in current relation type with the same name.
checkRoleInfosback to summary
pack-priv static void checkRoleInfos(RoleInfo[] roleInfoArray) throws IllegalArgumentException, InvalidRelationTypeException
getRelationTypeNameback to summary
public String getRelationTypeName()

Implements javax.management.relation.RelationType.getRelationTypeName.

Returns the relation type name.

Returns:String

the relation type name.

getRoleInfoback to summary
public RoleInfo getRoleInfo(String roleInfoName) throws IllegalArgumentException, RoleInfoNotFoundException

Implements javax.management.relation.RelationType.getRoleInfo.

Returns the role info (RoleInfo object) for the given role info name (null if not found).

Parameters
roleInfoName:String

role info name

Returns:RoleInfo

RoleInfo object providing role definition does not exist

Exceptions
IllegalArgumentException:
if null parameter
RoleInfoNotFoundException:
if no role info with that name in relation type.
getRoleInfosback to summary
public List<RoleInfo> getRoleInfos()

Implements javax.management.relation.RelationType.getRoleInfos.

Returns the list of role definitions (ArrayList of RoleInfo objects).

initMembersback to summary
private void initMembers(String relationTypeName, RoleInfo[] roleInfoArray) throws IllegalArgumentException, InvalidRelationTypeException
readObjectback to summary
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException

Deserializes a RelationTypeSupport from an ObjectInputStream.

setRelationServiceFlagback to summary
pack-priv void setRelationServiceFlag(boolean flag)
writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException

Serializes a RelationTypeSupport to an ObjectOutputStream.