org.norther.tammi.core.converter
Class DefaultObjectNameConverter

java.lang.Object
  extended by org.norther.tammi.core.base.Adaptee
      extended by org.norther.tammi.core.converter.DefaultObjectConverter<Object>
          extended by org.norther.tammi.core.converter.DefaultObjectNameConverter
All Implemented Interfaces:
Serializable, NotificationBroadcaster, NotificationEmitter, Manageable, MBeanDelegate, ObjectConverter<Object>

public class DefaultObjectNameConverter
extends DefaultObjectConverter<Object>

A converter for references between related MBeans. It produces either direct references or javax.management.ObjectName instances.

Version:
$Id: DefaultObjectNameConverter.java,v 1.13 2009/10/29 21:39:57 cvsimp Exp $
Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.norther.tammi.core.base.Adaptee
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS
 
Constructor Summary
DefaultObjectNameConverter()
          Constructs a new converter.
 
Method Summary
protected  Object getComponentInstance(String className, Object object, String pattern)
          Gets an object name instance converted from a string.
protected  String toComponentString(String className, Object object, String pattern)
          Returns the string representation of an object name.
 
Methods inherited from class org.norther.tammi.core.converter.DefaultObjectConverter
fromLocalizedObject, getFormatPattern, getInstance, getInstance, getInstance, getLocalizedPattern, getResourceFinderName, postmanaged, setResourceFinderName, toLocalizedObject, toString, toString, toString, toStrings, toStrings, toStrings, unmanaged
 
Methods inherited from class org.norther.tammi.core.base.Adaptee
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultObjectNameConverter

public DefaultObjectNameConverter()
Constructs a new converter.

Method Detail

getComponentInstance

protected Object getComponentInstance(String className,
                                      Object object,
                                      String pattern)
                               throws ConversionException
Gets an object name instance converted from a string. First the source string is converted to an object name as such. If the conversion fails and the pattern is not null, the object name is searched for by using the pattern as an object name query key.

Overrides:
getComponentInstance in class DefaultObjectConverter<Object>
Parameters:
className - the name of the class.
object - the source object.
pattern - the conversion pattern.
Returns:
the instance.
Throws:
ConversionException - if conversion fails.

toComponentString

protected String toComponentString(String className,
                                   Object object,
                                   String pattern)
Returns the string representation of an object name. If the pattern is not null and the object name is not a pattern, the string representation is either a key value from the object name mapped to the pattern or a value of a MBean attribute named according to the pattern. Otherwise the string representation is the object name itself as a string.

Overrides:
toComponentString in class DefaultObjectConverter<Object>
Parameters:
className - the name of the class.
object - the source object.
pattern - the conversion pattern.
Returns:
the string representation.


Copyright © 2004 The Norther Organization. All rights reserved.