Thursday, April 29, 2010

Quick WLST script to setup JMS Server, Connection Factory and Queue

see also http://download.oracle.com/docs/cd/E13222_01/wls/docs91/config_scripting/using_WLST.html


setWLSEnv.cmd
java weblogic.WLST
execfile('myfile.py')

connect('weblogic', 'weblogic', 't3://localhost:7001')
startEdit()

cd('/')
cmo.createJMSSystemResource('ExceptionHandlingModule')

cd('/SystemResources/ExceptionHandlingModule')
set('Targets',jarray.array([ObjectName('com.bea:Name=AdminServer,Type=Server')], ObjectName))
cmo.createSubDeployment('acme.integration.ExceptionHandlingSubdeployment')

cd('/JMSSystemResources/ExceptionHandlingModule/JMSResource/ExceptionHandlingModule')
cmo.createConnectionFactory('acme.integration.QueueConnectionFactory')

cd('/JMSSystemResources/ExceptionHandlingModule/JMSResource/ExceptionHandlingModule/ConnectionFactories/acme.integration.QueueConnectionFactory')
cmo.setJNDIName('acme.integration.QueueConnectionFactory')

cd('/JMSSystemResources/ExceptionHandlingModule/JMSResource/ExceptionHandlingModule/ConnectionFactories/acme.integration.QueueConnectionFactory/SecurityParams/acme.integration.QueueConnectionFactory')
cmo.setAttachJMSXUserId(false)

cd('/SystemResources/ExceptionHandlingModule/SubDeployments/acme.integration.ExceptionHandlingSubdeployment')
set('Targets',jarray.array([], ObjectName))

cd('/JMSSystemResources/ExceptionHandlingModule/JMSResource/ExceptionHandlingModule/ConnectionFactories/acme.integration.QueueConnectionFactory')
cmo.setSubDeploymentName('acme.integration.ExceptionHandlingSubdeployment')

cd('/')
cmo.createFileStore('exceptionHandlingStore')

cd('/FileStores/exceptionHandlingStore')
set('Targets',jarray.array([ObjectName('com.bea:Name=AdminServer,Type=Server')], ObjectName))

cd('/')
cmo.createJMSServer('exceptionHandlingServer')

cd('/Deployments/exceptionHandlingServer')
cmo.setPersistentStore(getMBean('/FileStores/exceptionHandlingStore'))
set('Targets',jarray.array([ObjectName('com.bea:Name=AdminServer,Type=Server')], ObjectName))

cd('/SystemResources/ExceptionHandlingModule/SubDeployments/acme.integration.ExceptionHandlingSubdeployment')
set('Targets',jarray.array([ObjectName('com.bea:Name=exceptionHandlingServer,Type=JMSServer')], ObjectName))

cd('/JMSSystemResources/ExceptionHandlingModule/JMSResource/ExceptionHandlingModule')
cmo.createQueue('acme.integration.osbErrorQueue')

cd('/JMSSystemResources/ExceptionHandlingModule/JMSResource/ExceptionHandlingModule/Queues/acme.integration.osbErrorQueue')
cmo.setJNDIName('acme.integration.osbErrorQueue')
cmo.setSubDeploymentName('acme.integration.ExceptionHandlingSubdeployment')

cd('/SystemResources/ExceptionHandlingModule/SubDeployments/acme.integration.ExceptionHandlingSubdeployment')
set('Targets',jarray.array([ObjectName('com.bea:Name=exceptionHandlingServer,Type=JMSServer')], ObjectName))

activate()


No comments: