admin@glassfish.java.net

AMX create/remove working

From: Lloyd L Chambers <Lloyd.Chambers_at_Sun.COM>
Date: Thu, 27 Mar 2008 18:35:27 -0700

Anissa,

I've tested out all the resource types below (see the jmxcmd commands
below). All work correctly for create and remove. I haven't tested
all create and remove operations for all MBeans, but I expect that
most of them will work, though not all are annotated and will fail for
that reason (easy fix).

Please be sure to use domainConfig.getResources().create/
remove<Name>(...) for the create/remove to work (API change).

You will need to update hk2/config, common/amx-api, common/amx-impl,
admin/config-api and common/glassfish-api modules.

Lloyd

target j2eeType=X-ResourcesConfig

createPersistenceManagerFactoryResourceConfig:persist1,null
createJNDIResourceConfig:jndi1,jndi1-lookup,rt1,com.foo.bar,null
createCustomResourceConfig:custom1,res-type-1,com.foo.bar,null
createMailResourceConfig:mail1,localhost,mail-user,foo_at_bar.com,null
createResourceAdapterConfig:ra1,null
createJDBCConnectionPoolConfig:pool1,com.foo.bar,null
createConnectorResourceConfig:crc,pool1,null
createConnectorConnectionPoolConfig:ccp1,an1,cdn,null
createAdminObjectResourceConfig:aor1,rt1,ra1,null
createResourceAdapterConfig:rac1,null

get *ObjectNameMap

get ContaineeJ2EETypes,AttributeNames,ObjectName


removePersistenceManagerFactoryResourceConfig:persist1
removeJNDIResourceConfig:jndi1
removeResourceAdapterConfig:ra1
removeMailResourceConfig:mail1
removeCustomResourceConfig:custom1
removeJDBCConnectionPoolConfig:pool1
removeConnectorResourceConfig:crc
removeConnectorConnectionPoolConfig:ccp1
removeAdminObjectResourceConfig:aor1
removeResourceAdapterConfig:rac1



--------------------------
jmxcmd> target j2eeType=X-ResourcesConfig

createPersistenceManagerFactoryResourceConfig:persist1,null
createJNDIResourceConfig:jndi1,jndi1-lookup,rt1,com.foo.bar,null
createCustomResourceConfig:custom1,res-type-1,com.foo.bar,null
createMailResourceConfig:mail1,localhost,mail-user,foo_at_bar.com,null
createResourceAdapterConfig:ra1,null
createJDBCConnectionPoolConfig:pool1,com.foo.bar,null
createConnectorResourceConfig:crc,pool1,null
createConnectorConnectionPoolConfig:ccp1,an1,cdn,null
createAdminObjectResourceConfig:aor1,rt1,ra1,null
createResourceAdapterConfig:rac1,null

get *ObjectNameMap

get ContaineeJ2EETypes,AttributeNames,ObjectName


removePersistenceManagerFactoryResourceConfig:persist1
removeJNDIResourceConfig:jndi1
removeResourceAdapterConfig:ra1
removeMailResourceConfig:mail1
removeCustomResourceConfig:custom1
removeJDBCConnectionPoolConfig:pool1
removeConnectorResourceConfig:crc
removeConnectorConnectionPoolConfig:ccp1
removeAdminObjectResourceConfig:aor1
removeResourceAdapterCojmxcmd> jmxcmd> invoking
createPersistenceManagerFactoryResourceConfig(persist1,null) on
j2eeType=X-ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
amx:j2eeType=X-PersistenceManagerFactoryResourceConfig,name=persist1

jmxcmd> invoking createJNDIResourceConfig(jndi1,jndi1-
lookup,rt1,com.foo.bar,null) on j2eeType=X-ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
amx:j2eeType=X-JNDIResourceConfig,name=jndi1

jmxcmd> invoking createCustomResourceConfig(custom1,res-
type-1,com.foo.bar,null) on j2eeType=X-ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
amx:j2eeType=X-CustomResourceConfig,name=custom1

jmxcmd> invoking createMailResourceConfig(mail1,localhost,mail-user,foo_at_bar.com
,null) on j2eeType=X-ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
amx:j2eeType=X-MailResourceConfig,name=mail1

jmxcmd> invoking createResourceAdapterConfig(ra1,null) on j2eeType=X-
ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
amx:j2eeType=X-ResourceAdapterConfig,name=ra1

jmxcmd> invoking
createJDBCConnectionPoolConfig(pool1,com.foo.bar,null) on j2eeType=X-
ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
amx:j2eeType=X-JDBCConnectionPoolConfig,name=pool1

jmxcmd> invoking createConnectorResourceConfig(crc,pool1,null) on
j2eeType=X-ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
amx:j2eeType=X-ConnectorResourceConfig,name=crc

jmxcmd> invoking
createConnectorConnectionPoolConfig(ccp1,an1,cdn,null) on j2eeType=X-
ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
amx:j2eeType=X-ConnectorConnectionPoolConfig,name=ccp1

jmxcmd> invoking createAdminObjectResourceConfig(aor1,rt1,ra1,null) on
j2eeType=X-ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
amx:j2eeType=X-AdminObjectResourceConfig,name=aor1

jmxcmd> invoking createResourceAdapterConfig(rac1,null) on j2eeType=X-
ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
amx:j2eeType=X-ResourceAdapterConfig,name=rac1

jmxcmd> jmxcmd> ---amx:j2eeType=X-ResourcesConfig,name=na---
AdminObjectResourceConfigObjectNameMap={aor1=amx:j2eeType=X-
AdminObjectResourceConfig,name=aor1}
ConnectorConnectionPoolConfigObjectNameMap={ccp1=amx:j2eeType=X-
ConnectorConnectionPoolConfig,name=ccp1}
ConnectorResourceConfigObjectNameMap={crc=amx:j2eeType=X-
ConnectorResourceConfig,name=crc}
CustomResourceConfigObjectNameMap={custom1=amx:j2eeType=X-
CustomResourceConfig,name=custom1}
JDBCConnectionPoolConfigObjectNameMap={DerbyPool=amx:j2eeType=X-
JDBCConnectionPoolConfig,name=DerbyPool, __CallFlowPool=amx:j2eeType=X-
JDBCConnectionPoolConfig,name=__CallFlowPool,
__TimerPool=amx:j2eeType=X-JDBCConnectionPoolConfig,name=__TimerPool,
pool1=amx:j2eeType=X-JDBCConnectionPoolConfig,name=pool1}
JDBCResourceConfigObjectNameMap={jdbc/__CallFlowPool=amx:j2eeType=X-
JDBCResourceConfig,name=jdbc/__CallFlowPool, jdbc/
__TimerPool=amx:j2eeType=X-JDBCResourceConfig,name=jdbc/__TimerPool,
jdbc/__default=amx:j2eeType=X-JDBCResourceConfig,name=jdbc/__default}
JNDIResourceConfigObjectNameMap={jndi1=amx:j2eeType=X-
JNDIResourceConfig,name=jndi1}
MailResourceConfigObjectNameMap={mail1=amx:j2eeType=X-
MailResourceConfig,name=mail1}
PersistenceManagerFactoryResourceConfigObjectNameMap
={persist1=amx:j2eeType=X-
PersistenceManagerFactoryResourceConfig,name=persist1}
ResourceAdapterConfigObjectNameMap={rac1=amx:j2eeType=X-
ResourceAdapterConfig,name=rac1, ra1=amx:j2eeType=X-
ResourceAdapterConfig,name=ra1}

jmxcmd> jmxcmd> ---amx:j2eeType=X-ResourcesConfig,name=na---
AttributeNames={AttributeNames,MBeanInfoIsInvariant,JDBCConnectionPoolConfigObjectNameMap,JNDIResourceConfigObjectNameMap,ObjectName,Group,MBeanLogLevel,J2EEType,InterfaceName,CustomResourceConfigObjectNameMap,MBeanLoggerName,PersistenceManagerFactoryResourceConfigObjectNameMap,ContaineeJ2EETypes,DAS,Name,DomainRootObjectName,JDBCResourceConfigObjectNameMap,NotificationInfo,FullType,ConnectorConnectionPoolConfigObjectNameMap,MailResourceConfigObjectNameMap,AdminObjectResourceConfigObjectNameMap,ConnectorResourceConfigObjectNameMap,ResourceAdapterConfigObjectNameMap,ContainerObjectName,ContaineeObjectNameSet}
ContaineeJ2EETypes=X-MailResourceConfig,X-AdminObjectResourceConfig,X-
JDBCResourceConfig,X-ConnectorConnectionPoolConfig,X-
ResourceAdapterConfig,X-JNDIResourceConfig,X-
JDBCConnectionPoolConfig,X-CustomResourceConfig,X-
ConnectorResourceConfig,X-PersistenceManagerFactoryResourceConfig
ObjectName=amx:j2eeType=X-ResourcesConfig,name=na

jmxcmd> jmxcmd> jmxcmd> invoking
removePersistenceManagerFactoryResourceConfig(persist1) on j2eeType=X-
ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
<null>

jmxcmd> invoking removeJNDIResourceConfig(jndi1) on j2eeType=X-
ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
<null>

jmxcmd> invoking removeResourceAdapterConfig(ra1) on j2eeType=X-
ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
<null>

jmxcmd> invoking removeMailResourceConfig(mail1) on j2eeType=X-
ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
<null>

jmxcmd> invoking removeCustomResourceConfig(custom1) on j2eeType=X-
ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
<null>

jmxcmd> invoking removeJDBCConnectionPoolConfig(pool1) on j2eeType=X-
ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
<null>

jmxcmd> invoking removeConnectorResourceConfig(crc) on j2eeType=X-
ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
<null>

jmxcmd> invoking removeConnectorConnectionPoolConfig(ccp1) on
j2eeType=X-ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
<null>

jmxcmd> invoking removeAdminObjectResourceConfig(aor1) on j2eeType=X-
ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
<null>

jmxcmd> invoking removeResourceAdapterConfig(rac1) on j2eeType=X-
ResourcesConfig
---amx:j2eeType=X-ResourcesConfig,name=na---
<null>

jmxcmd> jmxcmd> jmxcmd> jmxcmd>
jmxcmd>