Java EE 5 SDK

com.sun.appserv.management.config
Interface PropertiesAccess

All Known Subinterfaces:
AdminObjectResourceConfig, AdminServiceConfig, AuditModuleConfig, AuthRealmConfig, AvailabilityServiceConfig, ClusterConfig, ClusteredServerConfig, ConfigConfig, ConnectorConnectionPoolConfig, ConnectorModuleConfig, ConnectorResourceConfig, CustomMBeanConfig, CustomResourceConfig, DASConfig, DiagnosticServiceConfig, DomainConfig, EJBContainerAvailabilityConfig, EJBContainerConfig, EJBModuleConfig, EJBTimerServiceConfig, EventConfig, GroupManagementServiceConfig, HTTPListenerConfig, HTTPServiceConfig, IIOPListenerConfig, J2EEApplicationConfig, JACCProviderConfig, JavaConfig, JDBCConnectionPoolConfig, JDBCResourceConfig, JMSAvailabilityConfig, JMSHostConfig, JMSServiceConfig, JMXConnectorConfig, JNDIResourceConfig, LBConfig, LifecycleModuleConfig, LoadBalancerConfig, LogServiceConfig, MailResourceConfig, ManagerPropertiesConfig, MDBContainerConfig, ModuleConfig, ModuleLogLevelsConfig, ModuleMonitoringLevelsConfig, MonitoringServiceConfig, NodeAgentConfig, ORBConfig, PersistenceManagerFactoryResourceConfig, ProfilerConfig, ProviderConfig, RARModuleConfig, RegistryLocationConfig, ResourceAdapterConfig, ResourceConfig, SecurityServiceConfig, ServerConfig, SessionPropertiesConfig, StandaloneServerConfig, StorePropertiesConfig, TransactionServiceConfig, VirtualServerConfig, WebContainerAvailabilityConfig, WebContainerConfig, WebModuleConfig

public interface PropertiesAccess

All MBeans that have Properties must extend this interface.

Properties are always Strings. Property names are required to be unique.

To specify properties when creating any type of AMXConfig which (the AMXConfig must extend PropertiesAccess), add them to the optional Map when creating it:


    final Map optional    = new HashMap();
    optional.put( PropertiesAccess.PROPERTY_PREFIX + "prop1", prop1Value );
    optional.put( PropertiesAccess.PROPERTY_PREFIX + "prop2", prop2Value );
    ...


Field Summary
static String PROPERTY_PREFIX
          When a key is required for a property in a Map, its name must consist of this prefix plus the actual name.
 
Method Summary
 void createProperty(String propertyName, String propertyValue)
          Create a new property.
 boolean existsProperty(String propertyName)
          Return true if any properties exist with the specified name.
 Map<String,String> getProperties()
           
 String[] getPropertyNames()
          Get the names of all properties.
 String getPropertyValue(String propertyName)
          Get the value of a property.
 void removeProperty(String propertyName)
          Remove a property with the specified name.
 void setPropertyValue(String propertyName, String propertyValue)
          Set the value of a property.
 

Field Detail

PROPERTY_PREFIX

static final String PROPERTY_PREFIX
When a key is required for a property in a Map, its name must consist of this prefix plus the actual name. When accessing a property directly, this prefix must not be used.

See Also:
Constant Field Values
Method Detail

getPropertyNames

String[] getPropertyNames()
Get the names of all properties.


getProperties

Map<String,String> getProperties()
Returns:
Map containing all properties, keyed by name

getPropertyValue

String getPropertyValue(String propertyName)
Get the value of a property.

Parameters:
propertyName - the name of the property

setPropertyValue

void setPropertyValue(String propertyName,
                      String propertyValue)
Set the value of a property. The property must already exist. The existing description is retained.

Parameters:
propertyName - the name of the property
propertyValue - the value of the property

existsProperty

boolean existsProperty(String propertyName)
Return true if any properties exist with the specified name.

Parameters:
propertyName - the name of the property

createProperty

void createProperty(String propertyName,
                    String propertyValue)
Create a new property.

Parameters:
propertyName - the name of the property
propertyValue - the value of the property

removeProperty

void removeProperty(String propertyName)
Remove a property with the specified name.

Parameters:
propertyName - the name of the property

Java EE 5 SDK

Submit a bug or feature

Copyright 2006 Sun Microsystems, Inc. All rights reserved.