/** * Allows a named object to be created. * * @param objectName The object name of the object. * @param object A reference to the object. */ public NamedObject(ObjectName objectName, Object object) { if (objectName.isPattern()) { throw new RuntimeOperationsException( new IllegalArgumentException("Invalid name->" + objectName.toString())); } this.name = objectName; this.object = object; }
/** * Allows a named object to be created. * * @param objectName The string representation of the object name of the object. * @param object A reference to the object. * @exception MalformedObjectNameException The string passed does not have the format of a valid * ObjectName */ public NamedObject(String objectName, Object object) throws MalformedObjectNameException { ObjectName objName = new ObjectName(objectName); if (objName.isPattern()) { throw new RuntimeOperationsException( new IllegalArgumentException("Invalid name->" + objName.toString())); } this.name = objName; this.object = object; }