Methods Summary |
---|
public java.lang.Object | getAttribute(javax.management.ObjectName mbeanName, java.lang.String attributeName)
Object returnValue = null;
AdminRequest request = new AdminRequest(AdminRequestType.GET_ATTRIBUTE);
AdminRequestConfigurator reqConfigurator =
new AdminRequestConfigurator(request);
reqConfigurator.setObjectName(mbeanName);
reqConfigurator.setAttributeName(attributeName);
reqConfigurator.setClientVersion(ADMIN_CLIENT_VERSION);
AdminResponse response = sendRequest(request);
//Assert.assert(response);
AdminResponseConfigurator resConfigurator =
new AdminResponseConfigurator(response);
if (resConfigurator.hasException())
{
Throwable t = resConfigurator.getException();
if (t instanceof AttributeNotFoundException)
{
throw (AttributeNotFoundException)t;
}
else if (t instanceof InstanceNotFoundException)
{
throw (InstanceNotFoundException)t;
}
else if (t instanceof MBeanException)
{
throw (MBeanException)t;
}
else if (t instanceof ReflectionException)
{
throw (ReflectionException)t;
}
else if (t instanceof RuntimeException)
{
throw (RuntimeException)t;
}
else if (t instanceof Error)
{
throw new RuntimeErrorException((Error)t);
}
}
else
{
returnValue = resConfigurator.getReturnValue();
}
return returnValue;
|
public javax.management.AttributeList | getAttributes(javax.management.ObjectName mbeanName, java.lang.String[] attributes)
AttributeList values = null;
AdminRequest request = new AdminRequest(
AdminRequestType.GET_ATTRIBUTES);
AdminRequestConfigurator reqConfigurator =
new AdminRequestConfigurator(request);
reqConfigurator.setObjectName(mbeanName);
reqConfigurator.setAttributeNames(attributes);
reqConfigurator.setClientVersion(ADMIN_CLIENT_VERSION);
AdminResponse response = sendRequest(request);
//Assert.assert(response);
AdminResponseConfigurator resConfigurator =
new AdminResponseConfigurator(response);
if (resConfigurator.hasException())
{
Throwable t = resConfigurator.getException();
if (t instanceof InstanceNotFoundException)
{
throw (InstanceNotFoundException)t;
}
else if (t instanceof ReflectionException)
{
throw (ReflectionException)t;
}
else if (t instanceof RuntimeException)
{
throw (RuntimeException)t;
}
else if (t instanceof Error)
{
throw new RuntimeErrorException((Error)t);
}
}
else
{
values = (AttributeList) resConfigurator.getReturnValue();
}
return values;
|
public java.lang.String | getClientVersion()
return ADMIN_CLIENT_VERSION;
|
public java.lang.Object | invoke(javax.management.ObjectName mbeanName, java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature)
Object returnValue = null;
AdminRequest request = new AdminRequest(AdminRequestType.INVOKE);
AdminRequestConfigurator reqConfigurator =
new AdminRequestConfigurator(request);
reqConfigurator.setObjectName(mbeanName);
reqConfigurator.setOperationName(operationName);
reqConfigurator.setOperationParams(params);
reqConfigurator.setOperationSignature(signature);
reqConfigurator.setClientVersion(ADMIN_CLIENT_VERSION);
AdminResponse response = sendRequest(request);
AdminResponseConfigurator resConfigurator =
new AdminResponseConfigurator(response);
if (resConfigurator.hasException())
{
Throwable t = resConfigurator.getException();
if (t instanceof InstanceNotFoundException)
{
throw (InstanceNotFoundException)t;
}
else if (t instanceof MBeanException)
{
throw (MBeanException)t;
}
else if (t instanceof ReflectionException)
{
throw (ReflectionException)t;
}
else if (t instanceof RuntimeException)
{
throw (RuntimeException)t;
}
else if (t instanceof Error)
{
throw new RuntimeErrorException((Error)t);
}
}
else
{
returnValue = resConfigurator.getReturnValue();
}
return returnValue;
|
private com.sun.enterprise.admin.common.AdminResponse | sendRequest(com.sun.enterprise.admin.common.AdminRequest request)
AdminResponse response = null;
IConnection connection = null;
try
{
connection = ConnectionFactory.createConnection(connectorAddress);
connection.send(request);
response = (AdminResponse)connection.receive();
}
catch (IOException e)
{
Debug.printStackTrace(e);
throw new AFConnectionException(e.getMessage());
}
catch (ClassNotFoundException cnfe)
{
throw new AFRuntimeException(cnfe.toString());
}
catch (Exception e)
{
throw new AFRuntimeException(e.getLocalizedMessage());
}
finally
{
if (connection != null)
{
try
{
connection.close();
}
catch (Exception e)
{
ExceptionUtil.ignoreException(e);
}
}
}
return response;
|
public void | setAttribute(javax.management.ObjectName mbeanName, javax.management.Attribute attribute)
AdminRequest request = new AdminRequest(AdminRequestType.SET_ATTRIBUTE);
AdminRequestConfigurator reqConfigurator =
new AdminRequestConfigurator(request);
reqConfigurator.setObjectName(mbeanName);
reqConfigurator.setAttribute(attribute);
reqConfigurator.setClientVersion(ADMIN_CLIENT_VERSION);
AdminResponse response = sendRequest(request);
//Assert.assert(response);
AdminResponseConfigurator resConfigurator =
new AdminResponseConfigurator(response);
if (resConfigurator.hasException())
{
Throwable t = resConfigurator.getException();
if (t instanceof AttributeNotFoundException)
{
throw (AttributeNotFoundException)t;
}
else if (t instanceof InvalidAttributeValueException)
{
throw (InvalidAttributeValueException)t;
}
else if (t instanceof InstanceNotFoundException)
{
throw (InstanceNotFoundException)t;
}
else if (t instanceof MBeanException)
{
throw (MBeanException)t;
}
else if (t instanceof ReflectionException)
{
throw (ReflectionException)t;
}
else if (t instanceof RuntimeException)
{
throw (RuntimeException)t;
}
else if (t instanceof Error)
{
throw new RuntimeErrorException((Error)t);
}
}
|
public javax.management.AttributeList | setAttributes(javax.management.ObjectName mbeanName, javax.management.AttributeList attributes)
AttributeList values = null;
AdminRequest request = new AdminRequest(
AdminRequestType.SET_ATTRIBUTES);
AdminRequestConfigurator reqConfigurator =
new AdminRequestConfigurator(request);
reqConfigurator.setObjectName(mbeanName);
reqConfigurator.setAttributeList(attributes);
reqConfigurator.setClientVersion(ADMIN_CLIENT_VERSION);
AdminResponse response = sendRequest(request);
//Assert.assert(response);
AdminResponseConfigurator resConfigurator =
new AdminResponseConfigurator(response);
if (resConfigurator.hasException())
{
Throwable t = resConfigurator.getException();
if (t instanceof InstanceNotFoundException)
{
throw (InstanceNotFoundException)t;
}
else if (t instanceof ReflectionException)
{
throw (ReflectionException)t;
}
else if (t instanceof RuntimeException)
{
throw (RuntimeException)t;
}
else if (t instanceof Error)
{
throw new RuntimeErrorException((Error)t);
}
}
else
{
values = (AttributeList) resConfigurator.getReturnValue();
}
return values;
|