Methods Summary |
---|
private void | addMandatoryVirtualServerProperties(javax.management.AttributeList al, java.util.Properties p)Adds the properties while creating the virtual server. This method
is required because of the bug 4963449. Once the dtd is modified,
we may not use this method and its call.
Date: Dec 09, 2003
setProperty(p, false, SystemPropertyConstants.ACCESSLOG_PROPERTY,
SystemPropertyConstants.getAccessLogDefaultValue());
final String ca =
AttributeListUtils.toJmx12Attribute(ServerTags.DEFAULT_WEB_MODULE);
if (! AttributeListUtils.
containsNamedAttribute(al, ca))
{
setProperty(p, false, SystemPropertyConstants.DOCROOT_PROPERTY,
SystemPropertyConstants.getDocRootDefaultValue());
}
else
{
final Attribute defaultWb =
(Attribute)AttributeListUtils.asNameMap(al).get(ca);
final String val = (String)defaultWb.getValue();
if ((val == null) || "".equals(val))
{
setProperty(p, false, SystemPropertyConstants.DOCROOT_PROPERTY,
SystemPropertyConstants.getDocRootDefaultValue());
}
}
|
public void | addUser(java.lang.String user, java.lang.String password, java.lang.String[] grps, java.lang.String realmName, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
realmName = (realmName != null) ?
realmName : getDefaultAuthRealm(target);
final ObjectName authRealm = getAuthRealmMBean(target, realmName);
invokeN(authRealm, "addUser", new Object[] {user, password, grps},
new String[] {String.class.getName(), String.class.getName(),
new String[0].getClass().getName()});
|
private void | assertIt(boolean b, java.lang.Object msg)
if (!b)
{
throw MBeanExceptionFormatter.toMBeanException(
null, msg.toString());
}
|
void | check1ToN(com.sun.enterprise.admin.target.Target target)
/*
* Assumption: A domain should not have an associated config.
* Calling getConfigTarget() on a DomainTarget must raise an
* exception.
*/
/* XXX QQ. Comment out to build. FIXME
boolean is1ToN = false;
try
{
final ConfigTarget ct = target.getConfigTarget();
is1ToN = ct.is1ToN(target);
}
catch (Exception e)
{
throw MBeanExceptionFormatter.toMBeanException(e, null);
}
if (is1ToN)
{
throw MBeanExceptionFormatter.toMBeanException(null,
localStrings.getString("configsMBean.multiple_refs"));
}
*/
|
private void | checkAndCreateAuthRealmKeyFile(com.sun.enterprise.config.serverbeans.AuthRealm authRealm)
//creates empty keyfile for file-realms if it's not exist
if(!FILE_REALM_CLASSNAME.equals(authRealm.getClassname()))
return; //only file realms have keyfile reference
ElementProperty prop = authRealm.getElementPropertyByName(KEYFILE_PATH_PROPERTY_NAME);
if(prop==null)
{
// String msg = localStrings.getString("configsMBean.no_keyfile_name_property");
// _sLogger.log(Level.WARNING, msg);
// throw new MBeanConfigException(msg);
return; //leave validation exception to config validator
}
String path=null;
try
{
path = resolveTokensForDas(prop.getValue());
// this is patch for file-realm only
// we need to create empty keyfile if it's not exist
File file;
if((file = new File(path))!=null && !file.exists())
file.createNewFile();
}
catch (Exception e)
{
String msg = localStrings.getString("configsMBean.can_not_create_keyfile", new Object[]{path});
_sLogger.log(Level.WARNING, msg);
throw new MBeanConfigException(msg);
}
|
private void | checkElementDoesnotExist(javax.management.ObjectName targetON, java.lang.String getter, java.lang.Object msg)
ObjectName on = null;
try
{
on = (ObjectName)invoke0(targetON, getter);
}
catch (MBeanException mbe)
{
//log??
}
if (on != null)
{
throw MBeanExceptionFormatter.toMBeanException(
null, msg.toString());
}
|
private com.sun.enterprise.config.serverbeans.ElementProperty[] | convertPropertiesToElementProperties(java.util.Properties props)
ArrayList list = new ArrayList();
Enumeration keys = props.keys();
while (keys.hasMoreElements())
{
final String key = (String)keys.nextElement();
ElementProperty property = new ElementProperty();
property.setName(key);
property.setValue((String)props.get(key));
list.add(property);
}
return (ElementProperty[])list.toArray(new ElementProperty[list.size()]);
|
private java.util.Properties | copyProperties(java.util.Properties p)Always returns a non null instance of {@link java.util.Properties}.
Following rules apply:
|
public javax.management.ObjectName | createAuditModule(javax.management.AttributeList attrs, java.util.Properties props, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName securityService = getSecurityServiceMBean(target);
final ObjectName on = (ObjectName)invoke1(securityService,
"createAuditModule", attrs, AttributeList.class.getName());
setProperties(on, props);
return on;
|
public javax.management.ObjectName | createAuthRealm(javax.management.AttributeList attrs, java.util.Properties props, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
//first, create standalone auth-realm
Config config = getConfigBeanForTarget(target);
SecurityService secService = config.getSecurityService();
ManagedConfigBean mcbSecService = getManagedConfigBean(secService);
AuthRealm authRealm = (AuthRealm)mcbSecService.createChildByType(
ServerTags.AUTH_REALM, attrs, props);
// Second, check keyfile
// we need to create empty keyfile if it's not exist
// file should exist already - synchronization problems???
checkAndCreateAuthRealmKeyFile(authRealm);
// Finally, add auth-realm o config context
mcbSecService.addChildBean(ServerTags.AUTH_REALM, authRealm, false);
return getConfigBeanObjectName(authRealm);
|
public javax.management.ObjectName | createEjbTimerService(javax.management.AttributeList al, java.util.Properties props, java.lang.String targetName)
final ObjectName ejbContainer = getEjbContainer(targetName);
final ObjectName on = (ObjectName)invoke1(ejbContainer,
"createEjbTimerService", al, AttributeList.class.getName());
setProperties(on, props);
return on;
|
public javax.management.ObjectName | createHttpListener(javax.management.AttributeList attrList, java.util.Properties props, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
//set the default acceptor threads if not specified in attrList
if(!ConfigMBeanUtil.attributeDefinedInList(attrList,
ServerTags.ACCEPTOR_THREADS)) {
attrList.add(new Attribute(ServerTags.ACCEPTOR_THREADS,
getDefaultHTTPListenerAcceptorThreads()));
}
ObjectName httpService = getHttpServiceMBean(target);
ObjectName mbean = (ObjectName)invoke1(httpService,
"createHttpListener", attrList, AttributeList.class.getName());
setProperties(mbean, props);
//4954870
try
{
HttpListenerVirtualServerAssociationMgr mgr =
new HttpListenerVirtualServerAssociationMgr(getConfigContext(),
target.getConfigRef());
mgr.addHttpListenerRef(mbean.getKeyProperty("id"));
}
catch (ConfigException ce)
{
throw MBeanExceptionFormatter.toMBeanException(ce, null);
}
//4954870
return mbean;
|
public javax.management.ObjectName | createIiopListener(javax.management.AttributeList attrList, java.util.Properties props, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
ObjectName iiopService = getIiopServiceMBean(target);
ObjectName mbean = (ObjectName)invoke1(iiopService,
"createIiopListener", attrList, AttributeList.class.getName());
setProperties(mbean, props);
return mbean;
|
public javax.management.ObjectName | createJaccProvider(javax.management.AttributeList attrs, java.util.Properties props, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName securityService = getSecurityServiceMBean(target);
final ObjectName jaccProvider = (ObjectName)invoke1(securityService,
"createJaccProvider", attrs, AttributeList.class.getName());
setProperties(jaccProvider, props);
return jaccProvider;
|
public javax.management.ObjectName | createJmsHost(javax.management.AttributeList attrs, java.util.Properties props, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName jmsService = getJmsServiceMBean(target, true);
final ObjectName jmsHost = (ObjectName)invoke1(jmsService,
"createJmsHost", attrs, AttributeList.class.getName());
setProperties(jmsHost, props);
return jmsHost;
|
public java.lang.String[] | createJvmOptions(java.lang.String[] options, boolean isProfiler, java.lang.String targetName)Adds the given jvm options to the existing set of jvm options.
Excludes the jvm options that already exist.
if (null == options)
{
throw new IllegalArgumentException(
localStrings.getString("configsMBean.null_jvm_options"));
}
final Target target = getTarget(targetName);
quoteOptionsWithSpaces(options);
check1ToN(target);
final String[] oldOptions = getJvmOptions(isProfiler, target);
final JvmOptionsHelper jvmOptions = new JvmOptionsHelper(oldOptions);
final String[] invalid = jvmOptions.addJvmOptions(options);
final ObjectName targetON = getJvmOptionsTargetObjectName(
target, isProfiler);
setAttribute0(targetON, "jvm_options", jvmOptions.getJvmOptionsAsStoredInXml());
postInvoke("createJvmOptions", null);
return invalid;
|
public javax.management.ObjectName | createManagerProperties(javax.management.AttributeList al, java.util.Properties props, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName sessionManager = getSessionManagerMBean(target, true);
final ObjectName on = (ObjectName)invoke1(sessionManager,
"createManagerProperties", al, AttributeList.class.getName());
setProperties(on, props);
return on;
|
public javax.management.ObjectName | createMessageSecurityProvider(java.lang.String messageLayer, java.lang.String providerId, java.lang.String providerType, java.lang.String providerClassName, java.lang.String requestAuthSource, java.lang.String requestAuthRecipient, java.lang.String responseAuthSource, java.lang.String responseAuthRecipient, boolean isDefaultProvider, java.util.Properties props, java.lang.String targetName)
//**********************************************************************
//message-security
/*
* Creates the message-security-config and provider-config sub elements
* for the security-service.
* If the message-layer doesnt exist a new subelement for message-security-config
* is created and then the provider-config is created under it.
*/
// auth-layer attribute of message-security-config
// provider id
// "client"/"server"/"client-server"
// The class-name of java class of the provider.
// requirement for message layer sender authentication (can be null)
// requirement for message layer receiver authentication (can be null)
// requirement for message layer sender authentication (can be null)
// requirement for message layer receiver authentication (can be null)
// set pro
//provider's properties
// target name (config, instance, cluster, or 'server')
final Target target = getTarget(targetName);
check1ToN(target);
final ConfigTarget configTarget = target.getConfigTarget();
boolean bMessageConfigJustCreated = false;
Config config = ConfigAPIHelper.getConfigByName(getConfigContext(), configTarget.getName());
SecurityService securityService = config.getSecurityService();
//message-security-config
MessageSecurityConfig messageSecurity = securityService.getMessageSecurityConfigByAuthLayer(messageLayer);
if(messageSecurity==null)
{
// we have to create it
messageSecurity = new MessageSecurityConfig();
messageSecurity.setAuthLayer(messageLayer);
bMessageConfigJustCreated = true;
}
//provider-config
ProviderConfig provider = new ProviderConfig();
provider.setClassName(providerClassName);
provider.setProviderId(providerId);
provider.setProviderType(providerType);
//properties
if (null != props)
{
provider.setElementProperty(convertPropertiesToElementProperties(props));
}
//request-policy
if(requestAuthSource!=null || requestAuthRecipient!=null )
{
RequestPolicy requestPolicy = new RequestPolicy();
if(requestAuthSource!=null)
requestPolicy.setAuthSource(requestAuthSource);
if(requestAuthRecipient!=null)
requestPolicy.setAuthRecipient(requestAuthRecipient);
provider.setRequestPolicy(requestPolicy);
}
//response-policy
if(responseAuthSource!=null || responseAuthRecipient!=null )
{
ResponsePolicy responsePolicy = new ResponsePolicy();
if(responseAuthSource!=null)
responsePolicy.setAuthSource(responseAuthSource);
if(responseAuthRecipient!=null)
responsePolicy.setAuthRecipient(responseAuthRecipient);
provider.setResponsePolicy(responsePolicy);
}
messageSecurity.addProviderConfig(provider);
//set default provider
if(isDefaultProvider)
{
if(PROVIDER_TYPE_SERVER.equals(providerType))
messageSecurity.setDefaultProvider(providerId);
else if(PROVIDER_TYPE_CLIENT.equals(providerType))
messageSecurity.setDefaultClientProvider(providerId);
else
{
messageSecurity.setDefaultProvider(providerId);
messageSecurity.setDefaultClientProvider(providerId);
}
}
if(bMessageConfigJustCreated)
{
securityService.addMessageSecurityConfig(messageSecurity);
}
return getMBeanRegistry().getMbeanObjectName("provider-config",
new String[]{getDomainName(), configTarget.getName(), messageLayer, providerId});
|
public javax.management.ObjectName | createProfiler(javax.management.AttributeList al, java.util.Properties props, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName javaConfig = getJavaConfigMBean(target);
checkElementDoesnotExist(javaConfig, "getProfiler",
localStrings.getString("configsMBean.profiler_exists"));
final ObjectName on = (ObjectName)invoke1(javaConfig,
"createProfiler", al, AttributeList.class.getName());
setProperties(on, props);
return on;
|
public javax.management.ObjectName | createSessionProperties(javax.management.AttributeList al, java.util.Properties props, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName sessionConfig = getSessionConfigMBean(target, true);
final ObjectName on = (ObjectName)invoke1(sessionConfig,
"createSessionProperties", al, AttributeList.class.getName());
setProperties(on, props);
return on;
|
public javax.management.ObjectName | createSsl(javax.management.AttributeList al, java.lang.String id, java.lang.String type, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
ObjectName targetON = getSslTargetObjectName(target, id, type);
if ("iiop-service".equals(type))
{
Config config = getConfigBeanForTarget(target);
IiopService iiopService = config.getIiopService();
SslClientConfig sslCfg = new SslClientConfig();
sslCfg.setXPath(sslCfg.getAbsoluteXPath(iiopService.getXPath()));
ManagedConfigBean mb = new ManagedConfigBean(
(ConfigBean)sslCfg, m_registry, getDomainName());
mb.createChildByType("ssl", al, null, true);
iiopService.setSslClientConfig(sslCfg);
return (ObjectName)ConfigMBeanHelper.getConfigBeanObjectName(
m_registry,
getDomainName(), sslCfg.getSsl());
}
checkElementDoesnotExist(targetON, "getSsl",
localStrings.getString("configsMBean.ssl_exists"));
ObjectName ret = (ObjectName)invoke1(targetON, "createSsl", al,
AttributeList.class.getName());
return ret;
|
private javax.management.ObjectName | createSslClientConfig(javax.management.ObjectName iiopService)
ObjectName ret = (ObjectName)invoke1(iiopService,
"createSslClientConfig", null,
AttributeList.class.getName());
return ret;
|
public javax.management.ObjectName | createStoreProperties(javax.management.AttributeList al, java.util.Properties props, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName sessionManager = getSessionManagerMBean(target, true);
final ObjectName on = (ObjectName)invoke1(sessionManager,
"createStoreProperties", al, AttributeList.class.getName());
setProperties(on, props);
return on;
|
public javax.management.ObjectName | createThreadPool(javax.management.AttributeList attrs, java.util.Properties props, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName threadPools = getThreadPoolsMBean(target);
final ObjectName threadPool = (ObjectName)invoke1(threadPools,
"createThreadPool", attrs, AttributeList.class.getName());
setProperties(threadPool, props);
return threadPool;
|
public javax.management.ObjectName | createVirtualServer(javax.management.AttributeList al, java.util.Properties props, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
ObjectName httpService = getHttpServiceMBean(target);
ObjectName mbean = (ObjectName)invoke1(httpService,
"createVirtualServer", al, AttributeList.class.getName());
final Properties nProps = copyProperties(props);
addMandatoryVirtualServerProperties(al, nProps); //"optional properties"
setProperties(mbean, nProps);
return mbean;
|
public boolean | deleteAuditModule(java.lang.String name, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName securityService = getSecurityServiceMBean(target);
invoke1(securityService, "removeAuditModuleByName", name,
String.class.getName());
return true;
|
public boolean | deleteAuthRealm(java.lang.String name, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName securityService = getSecurityServiceMBean(target);
invoke1(securityService, "removeAuthRealmByName", name,
String.class.getName());
return true;
|
public boolean | deleteEjbTimerService(java.lang.String targetName)
final ObjectName ejbContainer = getEjbContainer(targetName);
invoke0(ejbContainer, "removeEjbTimerService");
return true;
|
public boolean | deleteHttpListener(java.lang.String listenerId, java.lang.String targetName)
final Target target = getTarget(targetName);
//4954870
try
{
HttpListenerVirtualServerAssociationMgr mgr =
new HttpListenerVirtualServerAssociationMgr(getConfigContext(),
target.getConfigRef());
mgr.deleteHttpListenerRef(listenerId);
}
catch (ConfigException ce)
{
throw MBeanExceptionFormatter.toMBeanException(ce, null);
}
//4954870
check1ToN(target);
final ObjectName httpService = getHttpServiceMBean(target);
invoke1(httpService, "removeHttpListenerById", listenerId,
String.class.getName());
return true;
|
public boolean | deleteIiopListener(java.lang.String listenerId, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName iiopService = getIiopServiceMBean(target);
invoke1(iiopService, "removeIiopListenerById", listenerId,
String.class.getName());
return true;
|
public boolean | deleteJaccProvider(java.lang.String name, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName securityService = getSecurityServiceMBean(target);
invoke1(securityService, "removeJaccProviderByName", name,
String.class.getName());
return true;
|
public boolean | deleteJmsHost(java.lang.String name, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName jmsService = getJmsServiceMBean(target, false);
assertIt((jmsService != null),
localStrings.getString("configsMBean.no_jms_service"));
//START_BUG_FIX: 6178076
if(name.equals(getAttribute0(jmsService, "default_jms_host"))) {
// set it to null since the jms host is being deleted.
// runtime has default anyway.
setAttribute0(jmsService, "default_jms_host", null);
_sLogger.log(Level.FINE,
"default-jms-host attribute of jms-service for target "
+ targetName
+ " has been set to null");
}
//END_BUG_FIX: 6178076
invoke1(jmsService, "removeJmsHostByName", name,
String.class.getName());
return true;
|
public java.lang.String[] | deleteJvmOptions(java.lang.String[] options, boolean isProfiler, java.lang.String targetName)Deletes the given jvm options from the existing set of jvm options.
if (null == options)
{
throw new IllegalArgumentException(
localStrings.getString("configsMBean.null_jvm_options"));
}
quoteOptionsWithSpaces(options);
final Target target = getTarget(targetName);
check1ToN(target);
final String[] oldOptions = getJvmOptions(isProfiler, target);
final JvmOptionsHelper jvmOptions = new JvmOptionsHelper(oldOptions);
final String[] invalid = jvmOptions.deleteJvmOptions(options);
final ObjectName targetON = getJvmOptionsTargetObjectName(
target, isProfiler);
setAttribute0(targetON, "jvm_options", jvmOptions.getJvmOptionsAsStoredInXml());
postInvoke("deleteJvmOptions", null);
return invalid;
|
public boolean | deleteManagerProperties(java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName sessionManager = getSessionManagerMBean(target, false);
invoke0(sessionManager, "removeManagerProperties");
return true;
|
public boolean | deleteMessageSecurityProvider(java.lang.String messageLayer, java.lang.String providerId, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
Config config = ConfigAPIHelper.getConfigByName(getConfigContext(),
target.getConfigTarget().getName());
SecurityService securityService = config.getSecurityService();
MessageSecurityConfig messageSecurity =
securityService.getMessageSecurityConfigByAuthLayer(messageLayer);
if(messageSecurity==null)
{
String msg = localStrings.getString( "admin.mbeans.configs.message_security_config_not_found",
new Object[]{messageLayer, targetName});
throw new MBeanConfigException(msg);
}
ProviderConfig[] providers = messageSecurity.getProviderConfig();
if(providers.length==1 && providerId.equals(providers[0].getProviderId()))
{
securityService.removeMessageSecurityConfig(messageSecurity);
return true;
}
ProviderConfig provider = messageSecurity.getProviderConfigByProviderId(providerId);
if(provider==null)
{
String msg = localStrings.getString( "admin.mbeans.configs.security_provider_not_found", new Object[]{providerId, messageLayer, targetName});
throw new MBeanConfigException(msg);
}
messageSecurity.removeProviderConfig(provider);
return true;
|
public boolean | deleteProfiler(java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName javaConfig = getJavaConfigMBean(target);
invoke0(javaConfig, "removeProfiler");
return true;
|
public boolean | deleteSessionConfig(java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName webContainer = getChild("web-container", null, target);
invoke0(webContainer, "removeSessionConfig");
return true;
|
public boolean | deleteSessionProperties(java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName sessionConfig = getSessionConfigMBean(target, false);
invoke0(sessionConfig, "removeSessionProperties");
return true;
|
public boolean | deleteSsl(java.lang.String id, java.lang.String type, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName targetON = getSslTargetObjectName(target, id, type);
final String opName = "iiop-service".equals(type) ?
"removeSslClientConfig" : "removeSsl";
invoke0(targetON, opName);
return true;
|
public boolean | deleteStoreProperties(java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName sessionManager = getSessionManagerMBean(target, false);
invoke0(sessionManager, "removeStoreProperties");
return true;
|
public boolean | deleteThreadPool(java.lang.String threadPoolId, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName threadPools = getThreadPoolsMBean(target);
invoke1(threadPools, "removeThreadPoolByThreadPoolId",
threadPoolId, String.class.getName());
return true;
|
public boolean | deleteVirtualServer(java.lang.String id, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
final ObjectName httpService = (ObjectName)getHttpServiceMBean(target);
invoke1(httpService, "removeVirtualServerById", id,
String.class.getName());
return true;
|
private void | doPersistenceCheck(com.sun.enterprise.admin.meta.naming.MBeanNamingInfo info, com.sun.enterprise.config.ConfigContext ctx)
ConfigBean cb = null;
try
{
final String xpath = info.getXPath();
cb = ConfigBeansFactory.getConfigBeanByXPath(ctx, xpath);
if (null == cb)
{
throw new InstanceNotFoundException(
localStrings.getString("configsMBean.mbean_not_found",
info.getObjectName()));
}
}
catch (Exception e)
{
throw MBeanExceptionFormatter.toMBeanException(e, null);
}
|
private java.lang.Object | getAttribute0(javax.management.ObjectName on, java.lang.String attrName)
Object value = null;
try
{
value = getMBeanServer().getAttribute(on, attrName);
}
catch (Exception e)
{
throw MBeanExceptionFormatter.toMBeanException(e, null);
}
return value;
|
public javax.management.ObjectName | getAuditModule(java.lang.String name, java.lang.String targetName)
return getChild("audit-module", new String[]{name}, targetName);
|
public javax.management.ObjectName | getAuthRealm(java.lang.String name, java.lang.String targetName)
return getChild("auth-realm", new String[]{name}, targetName);
|
protected javax.management.ObjectName | getAuthRealmMBean(com.sun.enterprise.admin.target.Target target, java.lang.String name)
final ObjectName securityService = getSecurityServiceMBean(target);
final ObjectName authRealm = (ObjectName)invoke1(securityService,
"getAuthRealmByName", name, String.class.getName());
assertIt((authRealm != null), localStrings.getString(
"configsMBean.auth_realm_not_found", name));
return authRealm;
|
public javax.management.ObjectName | getChild(java.lang.String type, java.lang.String[] location, java.lang.String targetName)A generic operation that returns the ObjectName of a child element
given its type & parent's location.
eg:-
getChild("http-listener", new String[]{"http-listener-1"}, "server")
getChild("ssl", new String[] {"http-listener-1"}, null);
getChild("ejb-container", null, null);
return getChild(type, location, getListTarget(targetName));
|
protected javax.management.ObjectName | getChild(java.lang.String type, java.lang.String[] location, com.sun.enterprise.admin.target.Target target)
final MBeanRegistryEntry entry = getMBeanRegistryEntry(type);
final MBeanNamingInfo namingInfo = getMBeanNamingInfo(entry, type,
getObjectNameTokens(target, location));
doPersistenceCheck(namingInfo, getConfigContext());
final ObjectName on = getObjectName(namingInfo);
postInvoke("getChild", on);
return on;
|
protected com.sun.enterprise.config.serverbeans.Config | getConfigBeanForTarget(com.sun.enterprise.admin.target.Target target)
final ConfigTarget configTarget = target.getConfigTarget();
return ConfigAPIHelper.getConfigByName(getConfigContext(), configTarget.getName());
|
protected javax.management.ObjectName | getConfigMBean(com.sun.enterprise.admin.target.Target target)
ObjectName configMBean = null;
try
{
final ConfigTarget ct = target.getConfigTarget();
configMBean = new ObjectName(ct.getTargetObjectName(
new String[] {getDomainName()}));
postInvoke("getConfigMBean", configMBean);
}
catch (Exception e)
{
throw MBeanExceptionFormatter.toMBeanException(e, null);
}
return configMBean;
|
public java.lang.String | getConfigNameForTarget(java.lang.String targetName)Resolve target name to associated config name.
final Target target = getTarget(targetName);
final ConfigTarget configTarget = target.getConfigTarget();
return configTarget.getName();
|
protected java.lang.String | getConfigRef(com.sun.enterprise.admin.target.Target target)
String configRef = null;
try
{
configRef = target.getConfigRef();
}
catch (Exception e)
{
throw MBeanExceptionFormatter.toMBeanException(e, null);
}
return configRef;
|
protected java.lang.String | getDefaultAuthRealm(com.sun.enterprise.admin.target.Target target)
final ObjectName on = getSecurityServiceMBean(target);
return (String)getAttribute0(on, "default_realm");
|
protected java.lang.String | getDefaultHTTPListenerAcceptorThreads()
return DEFAULT_HTTP_LISTENER_ACCEPTOR_THREADS;
|
public javax.management.ObjectName | getEjbContainer(java.lang.String targetName)
return getChild("ejb-container", null, targetName);
|
public javax.management.ObjectName | getEjbTimerService(java.lang.String targetName)
return getChild("ejb-timer-service", null, targetName);
|
public java.lang.String[] | getGroupNames(java.lang.String user, java.lang.String realmName, java.lang.String targetName)
final Target target = getListTarget(targetName);
realmName = (realmName != null) ?
realmName : getDefaultAuthRealm(target);
final ObjectName authRealm = getAuthRealmMBean(target, realmName);
return (String[])invoke1(authRealm, "getUserGroupNames",
user, String.class.getName());
|
public javax.management.ObjectName | getHttpListener(java.lang.String id, java.lang.String targetName)
return getChild("http-listener", new String[]{id}, targetName);
|
protected javax.management.ObjectName | getHttpListenerMBean(com.sun.enterprise.admin.target.Target target, java.lang.String id)
return (ObjectName)invoke1(getHttpServiceMBean(target),
"getHttpListenerById", id, String.class.getName());
|
public javax.management.ObjectName | getHttpService(java.lang.String targetName)
return getChild("http-service", null, targetName);
|
protected javax.management.ObjectName | getHttpServiceMBean(com.sun.enterprise.admin.target.Target target)
final ObjectName configMBean = getConfigMBean(target);
ObjectName ret = (ObjectName)invoke0(configMBean, "getHttpService");
return ret;
|
public javax.management.ObjectName | getIiopListener(java.lang.String id, java.lang.String targetName)
return getChild("iiop-listener", new String[]{id}, targetName);
|
protected javax.management.ObjectName | getIiopListenerMBean(com.sun.enterprise.admin.target.Target target, java.lang.String id)
return (ObjectName)invoke1(getIiopServiceMBean(target),
"getIiopListenerById", id, String.class.getName());
|
public javax.management.ObjectName | getIiopService(java.lang.String targetName)
return getChild("iiop-service", null, targetName);
|
protected javax.management.ObjectName | getIiopServiceMBean(com.sun.enterprise.admin.target.Target target)
final ObjectName configMBean = getConfigMBean(target);
ObjectName ret = (ObjectName)invoke0(configMBean, "getIiopService");
return ret;
|
public javax.management.ObjectName | getJaccProvider(java.lang.String name, java.lang.String targetName)
return getChild("jacc-provider", new String[]{name}, targetName);
|
public javax.management.ObjectName | getJavaConfig(java.lang.String targetName)
return getChild("java-config", null, targetName);
|
protected javax.management.ObjectName | getJavaConfigMBean(com.sun.enterprise.admin.target.Target target)
final ObjectName configMBean = getConfigMBean(target);
final ObjectName ret = (ObjectName)invoke0(
configMBean, "getJavaConfig");
assertIt((ret != null),
localStrings.getString("configsMBean.no_java_config"));
return ret;
|
public javax.management.ObjectName | getJmsHost(java.lang.String name, java.lang.String targetName)
return getChild("jms-host", new String[]{name}, targetName);
|
public javax.management.ObjectName | getJmsService(java.lang.String targetName)
return getChild("jms-service", null, targetName);
|
protected javax.management.ObjectName | getJmsServiceMBean(com.sun.enterprise.admin.target.Target target, boolean create)
final ObjectName configMBean = getConfigMBean(target);
ObjectName on = null;
try
{
on = (ObjectName)invoke0(configMBean, "getJmsService");
}
catch (Exception e)
{
//log
}
if ((null == on) && create)
{
on = (ObjectName)invoke1(configMBean,
"createJmsService", null, AttributeList.class.getName());
}
return on;
|
protected java.lang.String[] | getJvmOptions(boolean isProfiler, com.sun.enterprise.admin.target.Target target)
final ObjectName targetON = getJvmOptionsTargetObjectName(
target, isProfiler);
String[] jvmOptions = (String[])getAttribute0(targetON, "jvm_options");
if (null == jvmOptions) { jvmOptions = new String[0]; }
return jvmOptions;
|
public java.lang.String[] | getJvmOptions(boolean isProfiler, java.lang.String targetName)
return getJvmOptions(isProfiler, getListTarget(targetName));
|
private javax.management.ObjectName | getJvmOptionsTargetObjectName(com.sun.enterprise.admin.target.Target target, boolean isProfiler)
ObjectName on = getJavaConfigMBean(target);
if (isProfiler)
{
on = (ObjectName)invoke0(on, "getProfiler");
}
assertIt((on != null), localStrings.getString(
"configsMBean.target_for_jvm_options_not_found"));
return on;
|
com.sun.enterprise.admin.target.Target | getListTarget(java.lang.String targetName)
try
{
return TargetBuilder.INSTANCE.createTarget(VALID_LIST_TYPES, targetName,
getConfigContext());
}
catch (Exception e)
{
throw MBeanExceptionFormatter.toMBeanException(e, null);
}
|
public javax.management.ObjectName | getLogService(java.lang.String targetName)
return getChild("log-service", null, targetName);
|
private com.sun.enterprise.admin.meta.naming.MBeanNamingInfo | getMBeanNamingInfo(com.sun.enterprise.admin.meta.MBeanRegistryEntry entry, java.lang.String type, java.lang.String[] loc)
MBeanNamingInfo namingInfo = null;
try
{
namingInfo = new MBeanNamingInfo(entry.getNamingDescriptor(),
type, loc);
}
catch (Exception e)
{
throw MBeanExceptionFormatter.toMBeanException(e, null);
}
return namingInfo;
|
protected com.sun.enterprise.admin.meta.MBeanRegistry | getMBeanRegistry()
assertIt((super.m_registry != null),
localStrings.getString("configsMBean.null_registry"));
return super.m_registry;
|
private com.sun.enterprise.admin.meta.MBeanRegistryEntry | getMBeanRegistryEntry(java.lang.String type)
MBeanRegistryEntry entry = null;
try
{
entry = getMBeanRegistry().findMBeanRegistryEntryByType(type);
}
catch (Exception e)
{
throw MBeanExceptionFormatter.toMBeanException(e, null);
}
assertIt((entry != null),
localStrings.getString("configsMBean.no_registry_entry", type));
return entry;
|
protected javax.management.MBeanServer | getMBeanServer()
return com.sun.enterprise.admin.common.MBeanServerFactory.getMBeanServer();
|
public javax.management.ObjectName | getManagerProperties(java.lang.String targetName)
return getChild("manager-properties", null, targetName);
|
public javax.management.ObjectName | getMdbContainer(java.lang.String targetName)
return getChild("mdb-container", null, targetName);
|
private javax.management.ObjectName[] | getMessageSecurityProviders(com.sun.enterprise.config.serverbeans.MessageSecurityConfig messageSecurity)
ProviderConfig[] providers = messageSecurity.getProviderConfig();
return ConfigMBeanHelper.getConfigBeansObjectNames(
this.getMBeanRegistry(), this.getDomainName(), providers);
|
public javax.management.ObjectName | getModuleLogLevels(java.lang.String targetName)
return getChild("module-log-levels", null, targetName);
|
public javax.management.ObjectName | getModuleMonitoringLevels(java.lang.String targetName)
return getChild("module-monitoring-levels", null, targetName);
|
public javax.management.ObjectName | getMonitoringService(java.lang.String targetName)
return getChild("monitoring-service", null, targetName);
|
private javax.management.ObjectName | getObjectName(com.sun.enterprise.admin.meta.naming.MBeanNamingInfo info)
ObjectName on = null;
try
{
on = info.getObjectName();
}
catch (Exception e)
{
throw MBeanExceptionFormatter.toMBeanException(e, null);
}
return on;
|
protected java.lang.String[] | getObjectNameTokens(com.sun.enterprise.admin.target.Target target, java.lang.String[] location)
if (null == location) { location = new String[0]; }
final String[] onTokens = new String[location.length + 2];
onTokens[0] = getDomainName();
onTokens[1] = getConfigRef(target);
for (int i = 0; i < location.length; i++)
{
onTokens[i+2] = location[i];
}
return onTokens;
|
public javax.management.ObjectName | getOrb(java.lang.String targetName)
return getChild("orb", null, targetName);
|
public javax.management.ObjectName | getProfiler(java.lang.String targetName)
return getChild("profiler", null, targetName);
|
private java.lang.Object | getPropertyValue0(javax.management.ObjectName on, java.lang.String propName)
Object value = null;
try
{
value = invoke1(on, "getPropertyValue", propName, "java.lang.String");
}
catch (Exception e)
{
throw MBeanExceptionFormatter.toMBeanException(e, null);
}
return value;
|
public javax.management.ObjectName | getSecurityService(java.lang.String targetName)
return getChild("security-service", null, targetName);
|
protected javax.management.ObjectName | getSecurityServiceMBean(com.sun.enterprise.admin.target.Target target)
final ObjectName configMBean = getConfigMBean(target);
ObjectName ret = (ObjectName)invoke0(configMBean, "getSecurityService");
return ret;
|
protected javax.management.ObjectName | getSessionConfigMBean(com.sun.enterprise.admin.target.Target target, boolean create)
ObjectName sessionConfig = null;
try
{
sessionConfig = getChild("session-config", null, target);
}
catch (MBeanException mbe)
{
if (create)
{
//Create it
final ObjectName webContainer =
getChild("web-container", null, target);
sessionConfig = (ObjectName)invoke1(webContainer,
"createSessionConfig", null, AttributeList.class.getName());
}
else
{
throw mbe;
}
}
return sessionConfig;
|
protected javax.management.ObjectName | getSessionManagerMBean(com.sun.enterprise.admin.target.Target target, boolean create)
final ObjectName sessionConfig = getSessionConfigMBean(target, create);
ObjectName sessionManager = null;
try
{
sessionManager = getChild("session-manager", null, target);
}
catch (MBeanException mbe)
{
if (create)
{
//Create it
sessionManager = (ObjectName)invoke1(sessionConfig,
"createSessionManager", null, AttributeList.class.getName());
}
else
{
throw mbe;
}
}
return sessionManager;
|
public javax.management.ObjectName | getSessionProperties(java.lang.String targetName)
return getChild("session-properties", null, targetName);
|
public javax.management.ObjectName | getSsl(java.lang.String type, java.lang.String id, java.lang.String targetName)
final Target target = getListTarget(targetName);
ObjectName sslTarget = getSslTargetObjectName(target, id, type);
if ("iiop-service".equals(type))
{
sslTarget = (ObjectName)invoke0(sslTarget, "getSslClientConfig");
}
return (ObjectName)invoke0(sslTarget, "getSsl");
|
protected javax.management.ObjectName | getSslTargetObjectName(com.sun.enterprise.admin.target.Target target, java.lang.String id, java.lang.String type)
ObjectName on = null;
if ("http-listener".equals(type))
{
on = getHttpListenerMBean(target, id);
}
else if ("iiop-listener".equals(type))
{
on = getIiopListenerMBean(target, id);
}
else if ("iiop-service".equals(type))
{
on = getIiopServiceMBean(target);
}
else
{
throw MBeanExceptionFormatter.toMBeanException(null,
localStrings.getString("configsMBean.invalid_ssl_target_type",
type));
}
assertIt((on != null),
localStrings.getString("configsMBean.target_for_ssl_not_found"));
return on;
|
public javax.management.ObjectName | getStoreProperties(java.lang.String targetName)
return getChild("store-properties", null, targetName);
|
com.sun.enterprise.admin.target.Target | getTarget(java.lang.String targetName)
try
{
Target target = TargetBuilder.INSTANCE.createTarget(VALID_CREATE_DELETE_TYPES, targetName,
getConfigContext());
if (target.getType() == TargetType.SERVER ||
target.getType() == TargetType.DAS) {
//If we are operating on a server, ensure that the server is the only entity
//referencing its config
String configName = ServerHelper.getConfigForServer(getConfigContext(),
target.getName()).getName();
if (!ConfigAPIHelper.isConfigurationReferencedByServerOnly(getConfigContext(),
configName, target.getName())) {
throw new ConfigException(localStrings.getString(
"configurationHasMultipleRefs", target.getName(), configName,
ConfigAPIHelper.getConfigurationReferenceesAsString(
getConfigContext(), configName)));
}
} else if (target.getType() == TargetType.CLUSTER) {
//If we are operating on a cluster, ensure that the cluster is the only entity
//referencing its config
String configName = ClusterHelper.getConfigForCluster(getConfigContext(),
target.getName()).getName();
if (!ConfigAPIHelper.isConfigurationReferencedByClusterOnly(getConfigContext(),
configName, target.getName())) {
throw new ConfigException(localStrings.getString(
"configurationHasMultipleRefs", target.getName(), configName,
ConfigAPIHelper.getConfigurationReferenceesAsString(
getConfigContext(), configName)));
}
}
return target;
}
catch (Exception e)
{
throw MBeanExceptionFormatter.toMBeanException(e, null);
}
|
public javax.management.ObjectName | getThreadPool(java.lang.String threadPoolId, java.lang.String targetName)
return getChild("thread-pool", new String[] {threadPoolId}, targetName);
|
protected javax.management.ObjectName | getThreadPoolsMBean(com.sun.enterprise.admin.target.Target target)
final ObjectName configMBean = getConfigMBean(target);
ObjectName ret = (ObjectName)invoke0(configMBean, "getThreadPools");
return ret;
|
public javax.management.ObjectName | getTransactionService(java.lang.String targetName)
return getChild("transaction-service", null, targetName);
|
public java.lang.String[] | getUserNames(java.lang.String realmName, java.lang.String targetName)
final Target target = getListTarget(targetName);
realmName = (realmName != null) ?
realmName : getDefaultAuthRealm(target);
final ObjectName authRealm = getAuthRealmMBean(target, realmName);
return (String[])invoke0(authRealm, "getUserNames");
|
public javax.management.ObjectName | getVirtualServer(java.lang.String id, java.lang.String targetName)
return getChild("virtual-server", new String[]{id}, targetName);
|
public javax.management.ObjectName | getWebContainer(java.lang.String targetName)
return getChild("web-container", null, targetName);
|
private java.lang.Object | invoke0(javax.management.ObjectName on, java.lang.String opName)
return invokeN(on, opName, null, null);
|
private java.lang.Object | invoke1(javax.management.ObjectName on, java.lang.String opName, java.lang.Object o, java.lang.String cls)
return invokeN( on, opName, new Object[] {o}, new String[] {cls} );
|
private java.lang.Object | invokeN(javax.management.ObjectName on, java.lang.String opName, java.lang.Object[] params, java.lang.String[] signature)
Object ret = null;
try
{
ret = getMBeanServer().invoke(on, opName, params, signature);
postInvoke(opName, ret);
}
catch (Exception e)
{
throw MBeanExceptionFormatter.toMBeanException(e, null);
}
return ret;
|
public javax.management.ObjectName[] | listAuditModules(java.lang.String targetName)
final Target target = getListTarget(targetName);
final ObjectName securityService = getSecurityServiceMBean(target);
return (ObjectName[])invoke0(securityService, "getAuditModule");
|
public javax.management.ObjectName[] | listAuthRealms(java.lang.String targetName)
final Target target = getListTarget(targetName);
ObjectName securityService = getSecurityServiceMBean(target);
ObjectName[] ret = (ObjectName[])invoke0(securityService,
"getAuthRealm");
return ret;
|
public javax.management.ObjectName[] | listHttpListeners(java.lang.String targetName)
final Target target = getListTarget(targetName);
ObjectName httpService = getHttpServiceMBean(target);
ObjectName[] ret = (ObjectName[])invoke0(httpService,
"getHttpListener");
return ret;
|
public javax.management.ObjectName[] | listIiopListeners(java.lang.String targetName)
final Target target = getListTarget(targetName);
ObjectName iiopService = getIiopServiceMBean(target);
ObjectName[] ret = (ObjectName[])invoke0(iiopService,
"getIiopListener");
return ret;
|
public javax.management.ObjectName[] | listJaccProviders(java.lang.String targetName)
final Target target = getListTarget(targetName);
final ObjectName securityService = getSecurityServiceMBean(target);
return (ObjectName[])invoke0(securityService, "getJaccProvider");
|
public javax.management.ObjectName[] | listJmsHosts(java.lang.String targetName)
final Target target = getListTarget(targetName);
final ObjectName jmsService = getJmsServiceMBean(target, false);
assertIt((jmsService != null),
localStrings.getString("configsMBean.no_jms_service"));
return (ObjectName[])invoke0(jmsService, "getJmsHost");
|
public javax.management.ObjectName[] | listMessageSecurityProviders(java.lang.String messageLayer, java.lang.String targetName)
final Target target = getListTarget(targetName);
Config config = ConfigAPIHelper.getConfigByName(getConfigContext(),
target.getConfigTarget().getName());
SecurityService securityService = config.getSecurityService();
if(securityService==null)
return null;
if(messageLayer!=null)
{
MessageSecurityConfig messageSecurity =
securityService.getMessageSecurityConfigByAuthLayer(messageLayer);
if(messageSecurity==null)
{
String msg = localStrings.getString( "admin.mbeans.configs.message_security_config_not_found",
new Object[]{messageLayer, targetName});
throw new MBeanConfigException(msg);
}
return getMessageSecurityProviders(messageSecurity);
}
//here we are for null-messageLayer only
MessageSecurityConfig[] messageSecurities =
securityService.getMessageSecurityConfig();
ArrayList arr = new ArrayList();
if(messageSecurities!=null)
for(int i=0; i<messageSecurities.length; i++)
{
ObjectName[] names = getMessageSecurityProviders(messageSecurities[i]);
if(names!=null)
for(int j=0; j<names.length; j++)
arr.add(names[j]);
}
return (ObjectName[])arr.toArray(new ObjectName[arr.size()]);
|
public javax.management.ObjectName[] | listThreadPools(java.lang.String targetName)
final Target target = getListTarget(targetName);
final ObjectName threadPools = getThreadPoolsMBean(target);
return (ObjectName[])invoke0(threadPools, "getThreadPool");
|
public javax.management.ObjectName[] | listVirtualServers(java.lang.String targetName)
final Target target = getListTarget(targetName);
ObjectName httpService = getHttpServiceMBean(target);
ObjectName[] ret = (ObjectName[])invoke0(httpService,
"getVirtualServer");
return ret;
|
protected void | postInvoke(java.lang.String opName, java.lang.Object ret)
|
protected void | preInvoke(java.lang.String opName, java.lang.Object[] params, java.lang.String[] signature)
|
private void | quoteOptionsWithSpaces(java.lang.String[] options)
for(int i=0; i<options.length; i++)
{
if(options[i].indexOf(' ")>=0 &&
(!options[i].startsWith("\"") || !options[i].endsWith("\"")))
{
options[i] = "\"" + options[i] + "\"";
}
}
|
public void | removeUser(java.lang.String user, java.lang.String realmName, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
realmName = (realmName != null) ?
realmName : getDefaultAuthRealm(target);
final ObjectName authRealm = getAuthRealmMBean(target, realmName);
invoke1(authRealm, "removeUser", user, String.class.getName());
|
private java.lang.String | resolveTokensForDas(java.lang.String value)
String instanceName=MBeanRegistryFactory.getAdminContext().getServerName();
PropertyResolver resolver = new PropertyResolver(getConfigContext(), instanceName);
return resolver.resolve(value, true);
|
private void | setAttribute0(javax.management.ObjectName on, java.lang.String attrName, java.lang.Object value)
try
{
final Attribute attr = new Attribute(attrName, value);
getMBeanServer().setAttribute(on, attr);
}
catch (Exception e)
{
throw MBeanExceptionFormatter.toMBeanException(e, null);
}
|
private void | setProperties(javax.management.ObjectName on, java.util.Properties props)
if (null != props)
{
Enumeration keys = props.keys();
while (keys.hasMoreElements())
{
final String key = (String)keys.nextElement();
final Attribute property = new Attribute(key, props.get(key));
invoke1(on, "setProperty", property, Attribute.class.getName());
}
}
|
private void | setProperty(java.util.Properties table, boolean force, java.lang.String name, java.lang.String value)
if (force)
table.setProperty(name, value);
else
if (! table.containsKey(name))
table.setProperty(name, value);
|
public void | updateUser(java.lang.String user, java.lang.String password, java.lang.String[] grps, java.lang.String realmName, java.lang.String targetName)
final Target target = getTarget(targetName);
check1ToN(target);
realmName = (realmName != null) ?
realmName : getDefaultAuthRealm(target);
final ObjectName authRealm = getAuthRealmMBean(target, realmName);
invokeN(authRealm, "updateUser", new Object[] {user, password, grps},
new String[] {String.class.getName(), String.class.getName(),
new String[0].getClass().getName()});
|