com.sun.management.oss.impl
Class ManagedEntityKeyImpl

java.lang.Object
  extended bycom.sun.management.oss.impl.ManagedEntityKeyImpl
All Implemented Interfaces:
java.lang.Cloneable, ManagedEntityKey, java.io.Serializable, SerializerFactory
Direct Known Subclasses:
OperationalStatusMonitorKeyImpl, PerformanceMonitorKeyImpl

public class ManagedEntityKeyImpl
extends java.lang.Object
implements ManagedEntityKey

Title: JSR090 Reference Implementation Description: Copyright: Copyright 2001 Ericsson Radio Systems AB Company: Ericsson

Version:
0.2
Author:
Andreas Jirven, Anna Eriksson, Ali Feizabadi, Henrik Lindstr?m
See Also:
Serialized Form

Constructor Summary
ManagedEntityKeyImpl()
           
 
Method Summary
 java.lang.Object clone()
          Deep copy this key.
 ApplicationContext getApplicationContext()
          ApplicationContext used to locate the Application Components in charge of this managed entity
 java.lang.String getApplicationDN()
          The DN of the Application JNDI Naming Context.
 java.lang.String getDomain()
          The Domain name identifies an application's administrative domain.
 java.lang.Object getPrimaryKey()
          The unique identifier for the Managed Entity This key is mappable to the EJB primary key when the ManagedEntity is represented by an Entity Bean
 java.lang.String[] getSupportedSerializerTypes()
          Return all the serializer types than can be created by this factory.
 java.lang.String getType()
          Get the type of the ManagedEntityValue referenced by the ManagedEntityKey.
 ApplicationContext makeApplicationContext()
          Factory method for ApplicationContext
 java.lang.Object makePrimaryKey()
          Manufacture a PrimaryKey
 Serializer makeSerializer(java.lang.String serializerType)
          Manufacture a Serializer for the object type inheriting the interface.
 void setApplicationContext(ApplicationContext ctx)
          Set the application context.
 void setApplicationDN(java.lang.String dn)
          Set application DN.
 void setDomain(java.lang.String domain)
           
 void setPrimaryKey(java.lang.Object key)
          Sets a new value for the primary key.
 void setType(java.lang.String type)
          Set a new value for type.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ManagedEntityKeyImpl

public ManagedEntityKeyImpl()
Method Detail

makeApplicationContext

public ApplicationContext makeApplicationContext()
Factory method for ApplicationContext

Specified by:
makeApplicationContext in interface ManagedEntityKey
Returns:
ApplicationContext

getDomain

public java.lang.String getDomain()
The Domain name identifies an application's administrative domain. An administrative domain maintains a JNDI namespace.

Returns:
String domain name

setDomain

public void setDomain(java.lang.String domain)
               throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

getType

public java.lang.String getType()
Description copied from interface: ManagedEntityKey
Get the type of the ManagedEntityValue referenced by the ManagedEntityKey.

The type is part of ManagedEntityKey, because primaryKeys can be duplicate between ManagedEntityValue, implemented by the same class, but from different type (not java type).

Specified by:
getType in interface ManagedEntityKey
Returns:
String entity's type name

setType

public void setType(java.lang.String type)
             throws java.lang.IllegalArgumentException
Description copied from interface: ManagedEntityKey
Set a new value for type.

Specified by:
setType in interface ManagedEntityKey
Parameters:
type - the new value for type
Throws:
java.lang.IllegalArgumentException - if type is not valid.

getPrimaryKey

public java.lang.Object getPrimaryKey()
The unique identifier for the Managed Entity This key is mappable to the EJB primary key when the ManagedEntity is represented by an Entity Bean

Specified by:
getPrimaryKey in interface ManagedEntityKey
Returns:
the primary key

setPrimaryKey

public void setPrimaryKey(java.lang.Object key)
                   throws java.lang.IllegalArgumentException
Description copied from interface: ManagedEntityKey
Sets a new value for the primary key.

Specified by:
setPrimaryKey in interface ManagedEntityKey
Parameters:
key - the new value for the primary key.
Throws:
java.lang.IllegalArgumentException - if key is bad in some way.

getApplicationContext

public ApplicationContext getApplicationContext()
ApplicationContext used to locate the Application Components in charge of this managed entity

Specified by:
getApplicationContext in interface ManagedEntityKey
Returns:
ApplicationContext

setApplicationContext

public void setApplicationContext(ApplicationContext ctx)
Set the application context.

Specified by:
setApplicationContext in interface ManagedEntityKey
Parameters:
ctx - application context

getApplicationDN

public java.lang.String getApplicationDN()
The DN of the Application JNDI Naming Context. The format of this DN is:

optional deployment dependent top context/ System/system/ApplicatonType/Activation/Application/ major-minor-build-product/

under which the topics and homes of the application that is sending the event are deployed.

Specified by:
getApplicationDN in interface ManagedEntityKey
Returns:
DN of ApplicationDN

setApplicationDN

public void setApplicationDN(java.lang.String dn)
Set application DN.

Specified by:
setApplicationDN in interface ManagedEntityKey
Parameters:
dn - of application

makePrimaryKey

public java.lang.Object makePrimaryKey()
Manufacture a PrimaryKey

Specified by:
makePrimaryKey in interface ManagedEntityKey
Returns:
PrimaryKey implementation class

clone

public java.lang.Object clone()
Description copied from interface: ManagedEntityKey
Deep copy this key.

Specified by:
clone in interface ManagedEntityKey

toString

public java.lang.String toString()

getSupportedSerializerTypes

public java.lang.String[] getSupportedSerializerTypes()
Description copied from interface: SerializerFactory
Return all the serializer types than can be created by this factory. This may return an empty array, in case no serializer is implemented.

Specified by:
getSupportedSerializerTypes in interface SerializerFactory
Returns:
an array of supported serializer types.

makeSerializer

public Serializer makeSerializer(java.lang.String serializerType)
                          throws java.lang.IllegalArgumentException
Description copied from interface: SerializerFactory
Manufacture a Serializer for the object type inheriting the interface.

Specified by:
makeSerializer in interface SerializerFactory
Parameters:
serializerType - the class name of the serializer interface that must be created. For example XmlSerializer.getClass().getName()
Returns:
a serializer matching the serializer type .
Throws:
java.lang.IllegalArgumentException - if no serializer can be created matching the provided Serializer Type.