Methods Summary |
---|
public static java.util.Set | findAllClusterRefConfigs(com.sun.appserv.management.base.QueryMgr queryMgr)Find all {@link ClusterRefConfig}.
return
findAllRefConfigsByJ2EEType( queryMgr, XTypes.CLUSTER_REF_CONFIG );
|
public static java.util.Set | findAllDeployedItemRefConfigs(com.sun.appserv.management.base.QueryMgr queryMgr)Find all {@link DeployedItemRefConfig}.
return
findAllRefConfigsByJ2EEType( queryMgr, XTypes.DEPLOYED_ITEM_REF_CONFIG );
|
public static java.util.Set | findAllRefConfigs(com.sun.appserv.management.config.RefConfigReferent referent)Find all {@link RefConfig} that reference the specified j2eeType/name
combo.
final AMX amx = Util.asAMX( referent );
return findAllRefConfigsWithName( getQueryMgr( amx ),
getReferentRefJ2EEType( referent ),
amx.getName() );
|
public static java.util.Set | findAllRefConfigs(com.sun.appserv.management.config.RefConfigReferent referent, java.lang.String refJ2EEType)Find all {@link RefConfig} that reference the specified j2eeType/name
combo.
final AMX amx = Util.asAMX( referent );
return findAllRefConfigsWithName( getQueryMgr( amx ), refJ2EEType, amx.getName() );
|
public static java.util.Set | findAllRefConfigs(com.sun.appserv.management.config.DeployedItemRefConfigReferent referent)Find all {@link DeployedItemRefConfig} that reference
the specified item.
final AMX amx = Util.asAMX( referent );
return
findAllRefConfigsWithName( getQueryMgr( amx ), XTypes.DEPLOYED_ITEM_REF_CONFIG, amx.getName() );
|
public static java.util.Set | findAllRefConfigs(com.sun.appserv.management.config.ResourceRefConfigReferent referent)Find all {@link ResourceRefConfig} that reference
the specified item.
final AMX amx = Util.asAMX( referent );
return
findAllRefConfigsWithName( getQueryMgr( amx ), XTypes.RESOURCE_REF_CONFIG, amx.getName() );
|
public static java.util.Set | findAllRefConfigs(com.sun.appserv.management.config.ServerRefConfigReferent referent)Find all {@link ServerRefConfig} that reference
the specified item.
final AMX amx = Util.asAMX( referent );
return
findAllRefConfigsWithName( getQueryMgr( amx ), XTypes.SERVER_REF_CONFIG, amx.getName() );
|
public static java.util.Set | findAllRefConfigs(com.sun.appserv.management.config.ClusterRefConfigReferent referent)Find all {@link ClusterRefConfig} that reference
the specified item.
final AMX amx = Util.asAMX( referent );
return
findAllRefConfigsWithName( getQueryMgr( amx ), XTypes.CLUSTER_REF_CONFIG, amx.getName() );
|
public static java.util.Set | findAllRefConfigs(com.sun.appserv.management.base.QueryMgr queryMgr)Find all ref configs of any j2EEType
final Set<T> refs =
queryMgr.queryInterfaceSet( RefConfig.class.getName(), null);
return refs;
|
public static java.util.Set | findAllRefConfigsByJ2EEType(com.sun.appserv.management.base.QueryMgr queryMgr, java.lang.String refJ2EEType)Find all ref configs of the specified j2EEType
final Set<T> refs =
queryMgr.queryJ2EETypeSet( refJ2EEType );
return refs;
|
public static java.util.Set | findAllRefConfigsWithName(com.sun.appserv.management.base.QueryMgr queryMgr, java.lang.String refJ2EEType, java.lang.String name)Find all {@link RefConfig} of the specified j2EEType having
the specified name.
final String props = Util.makeRequiredProps( refJ2EEType, name );
final Set<T> refs = queryMgr.queryPatternSet( null, props );
return refs;
|
public static java.util.Set | findAllResourceRefConfigs(com.sun.appserv.management.base.QueryMgr queryMgr)Find all {@link ResourceRefConfig}.
return
findAllRefConfigsByJ2EEType( queryMgr, XTypes.RESOURCE_REF_CONFIG );
|
public static java.util.Set | findAllServerRefConfigs(com.sun.appserv.management.base.QueryMgr queryMgr)Find all {@link ServerRefConfig}.
return
findAllRefConfigsByJ2EEType( queryMgr, XTypes.SERVER_REF_CONFIG );
|
private static com.sun.appserv.management.util.misc.Output | getDebug()
return AMXDebug.getInstance().getOutput( "com.sun.appserv.management.helper.RefHelper" );
|
private static com.sun.appserv.management.base.QueryMgr | getQueryMgr(com.sun.appserv.management.base.AMX amx)
return amx.getDomainRoot().getQueryMgr();
|
public static java.util.Set | getReferentJ2EETypes()
return REFERENT_J2EE_TYPES;
|
public static java.lang.String | getReferentRefJ2EEType(com.sun.appserv.management.config.RefConfigReferent referent)
String j2eeType = null;
if ( referent instanceof ResourceRefConfigReferent )
{
j2eeType = XTypes.RESOURCE_REF_CONFIG;
}
else if ( referent instanceof DeployedItemRefConfigReferent )
{
j2eeType = XTypes.DEPLOYED_ITEM_REF_CONFIG;
}
else if ( referent instanceof ServerRefConfigReferent )
{
j2eeType = XTypes.SERVER_REF_CONFIG;
}
else if ( referent instanceof ClusterRefConfigReferent )
{
j2eeType = XTypes.CLUSTER_REF_CONFIG;
}
else
{
throw new IllegalArgumentException(
"Unknown referent class: " + Util.asAMX( referent ).getJ2EEType() );
}
return j2eeType;
|
public static java.util.Set | removeAllRefsTo(com.sun.appserv.management.config.RefConfigReferent item, boolean allowSingleFailure)
final Set<T> refs = RefHelper.findAllRefConfigs( item );
final Set<T> failures = RefHelper.removeRefConfigs( refs );
if ( failures.size() != 0 )
{
if ( failures.size() > 1 || ! allowSingleFailure )
{
final Set<ObjectName> objectNames = Util.toObjectNames( failures );
throw new IllegalArgumentException( "failure removing refererences:\n{" +
CollectionUtil.toString( objectNames, "\n" ) + "\n}" );
}
}
return failures;
|
public static java.util.Set | removeRefConfigs(java.util.Set refs)Remove all specified references (that are possible).
final Set<T> failures = new HashSet<T>();
for( final T ref : refs )
{
/* while deleting references, certain ones, such as those contained
within a cluster, implicitly delete other (redundant) references
eg references by clustered servers. Verify that a reference still
exists before attempting to delete it.
*/
final Extra extra = Util.getExtra( ref );
if ( extra.checkValid() )
{
final ConfigRemover rrc = ConfigRemover.class.cast( ref.getContainer() );
try
{
// may fail as illegal in PE or EE with one ref
rrc.removeConfig( ref.getJ2EEType(), ref.getName() );
}
catch( Exception e )
{
failures.add( ref );
}
}
}
return failures;
|