FileDocCategorySizeDatePackage
ResourceRefConfigFactory.javaAPI DocGlassfish v2 API4743Fri May 04 22:23:20 BST 2007com.sun.enterprise.management.config

ResourceRefConfigFactory

public class ResourceRefConfigFactory extends ConfigFactory

Fields Summary
Constructors Summary
public ResourceRefConfigFactory(ConfigFactoryCallback callbacks)

		super( callbacks );
	
Methods Summary
public javax.management.ObjectNamecreate(java.lang.String referencedResourceName, boolean enabled)

		final String j2eeType = getFactoryContainer().getJ2EEType();
		final String containerName = getFactoryContainer().getName();

		getOldResourcesMBean().createResourceReference(containerName, enabled, 
		        referencedResourceName);

		ObjectName pattern = null;
		if( XTypes.STANDALONE_SERVER_CONFIG.equals(j2eeType) )
		{
		    pattern = Util.newObjectNamePattern( "com.sun.appserv", 
		        "type=resource-ref,ref=" + referencedResourceName +
		        ",server=" + containerName);
		}
		else
		{
		    pattern = Util.newObjectNamePattern( "com.sun.appserv", 
		        "type=resource-ref,ref=" + referencedResourceName +
		        ",cluster=" + containerName);
		}

		final Set<ObjectName> oldNames =
		    JMXUtil.queryNames( getCallbacks().getMBeanServer(), pattern, null );
		final ObjectName oldObjectName = GSetUtil.getSingleton( oldNames );

		final ObjectName	amxName	= syncNewAMXMBeanWithOld( oldObjectName );

		return( amxName );
	
public javax.management.ObjectNamecreate(java.lang.String referencedResourceName)

		return create(referencedResourceName, null);
	
public javax.management.ObjectNamecreate(java.lang.String referencedResourceName, java.util.Map optional)

        final boolean enabled = (optional != null) &&
                "true".equalsIgnoreCase( ""+optional.get( ResourceConfigKeys.ENABLED_KEY ) );
		
		return create( referencedResourceName, enabled);
	
protected java.util.MapgetParamNameOverrides()

		return( MapUtil.newMap( AMXConfig.NAME_KEY, "ref" ) );
	
protected voidinternalRemove(javax.management.ObjectName objectName)

		final String containerName = getFactoryContainer().getName();

		getOldResourcesMBean().deleteResourceReference( containerName, Util.getName( objectName ));