flex.management.jmx.ObjectInstance Maven / Gradle / Ivy
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package flex.management.jmx;
import javax.management.MalformedObjectNameException;
/**
* Remotable ObjectInstance representation that complies with Flash serialization requirements.
*/
public class ObjectInstance
{
/**
* The object name part of the ObjectInstance
.
*/
public ObjectName objectName;
/**
* The class name part of the ObjectInstance
.
*/
public String className;
/**
* Constructs an empty ObjectInstance
instance.
*
*/
public ObjectInstance()
{}
/**
* Constructs a ObjectInstance
instance based upon a
* javax.management.ObjectInstance
instance.
*
* @param objectInstance The JMX ObjectInstance
instance to base this instance on.
*/
public ObjectInstance(javax.management.ObjectInstance objectInstance)
{
objectName = new ObjectName(objectInstance.getObjectName());
className = objectInstance.getClassName();
}
/**
* Utility method to convert this ObjectInstance
to a
* javax.management.ObjectInstance
instance.
*
* @return A JMX ObjectInstance
based upon this instance.
* @throws MalformedObjectNameException an exception
*/
public javax.management.ObjectInstance toObjectInstance() throws MalformedObjectNameException
{
return new javax.management.ObjectInstance(objectName.toObjectName(), className);
}
}