Package com.opencloud.slee.remote
Class RemoteProfiles.UncommittedProfile<T>
- java.lang.Object
-
- com.opencloud.slee.remote.RemoteProfiles.UncommittedProfile<T>
-
- Enclosing class:
- RemoteProfiles
public static class RemoteProfiles.UncommittedProfile<T> extends Object
Contains references and exposes utility methods needed to update and commit a newly-created profile.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseProfile()Close the profile.voidcommitProfile()Commit the profile.ObjectNamegetObjectName()Retrieve the ObjectName for the new profile.ProfileMBeangetProfileMBean()Retrieve the ProfileMBean proxy instance for the new profile.TgetProfileProxy()Retrieve a proxy instance for the profile itself, if this UncommittedProfile was created usingRemoteProfiles.createUncommittedProfile(javax.management.MBeanServerConnection,String,String,Class).voidrestoreProfile()Restore the profile.voidsetAttribute(String name, Object value)Set a single attribute of this uncommitted profile.voidsetAttributes(AttributeList attrs)Set several attributes of this uncommitted profile using an `AttributeList`.
-
-
-
Method Detail
-
getProfileMBean
public ProfileMBean getProfileMBean()
Retrieve the ProfileMBean proxy instance for the new profile. This is needed to commit the profile.- Returns:
- a ProfileMBean proxy
-
getObjectName
public ObjectName getObjectName()
Retrieve the ObjectName for the new profile.- Returns:
- an object name
-
getProfileProxy
public T getProfileProxy()
Retrieve a proxy instance for the profile itself, if this UncommittedProfile was created usingRemoteProfiles.createUncommittedProfile(javax.management.MBeanServerConnection,String,String,Class). This proxy can be used to set individual attributes by directly invoking their set method. Note that this will make one remote MBean call per invocation of a set method and is not recommended in situations where performance is important. (RemoteProfiles.setAttributes(javax.management.MBeanServerConnection, javax.management.ObjectName, javax.management.AttributeList)will set all attributes in one request, and is therefore more efficient.)- Returns:
- a profile proxy
-
restoreProfile
public void restoreProfile() throws ManagementException, InvalidStateExceptionRestore the profile. Equivalent to calling `getProfileMBean().restoreProfile()`.
-
commitProfile
public void commitProfile() throws InvalidStateException, ProfileVerificationException, ManagementExceptionCommit the profile. Equivalent to calling `getProfileMBean().commitProfile()`.
-
closeProfile
public void closeProfile() throws InvalidStateException, ManagementExceptionClose the profile. Equivalent to calling `getProfileMBean().closeProfile()`.
-
setAttribute
public void setAttribute(String name, Object value) throws AttributeNotFoundException, InvalidAttributeValueException, ManagementException
Set a single attribute of this uncommitted profile. Equivalent to calling `mBeanServerConnection.setAttribute(uncommmittedProfile.getObjectName(), new Attribute(name, value))`.- Parameters:
name- the attribute namevalue- value to set- Throws:
AttributeNotFoundExceptionInvalidAttributeValueExceptionManagementException- if the profile attributes could not be set due to a system-level failure.
-
setAttributes
public void setAttributes(AttributeList attrs) throws ManagementException
Set several attributes of this uncommitted profile using an `AttributeList`. Equivalent to calling `mBeanServerConnection.setAttributes(uncommmittedProfile.getObjectName(), attrs)`.- Parameters:
attrs- a JMX AttributeList object containing the attributes to be set- Throws:
ManagementException- if the profile attributes could not be set due to a system-level failure.
-
-