This script creates persistent stores targeted to a cluster. Input properties are specified in jms.properties
Before this script is run, set the environment using following command.
. $DOMAIN_HOME/bin/setDomainEnv.sh
Before this script is run, set the environment using following command.
. $DOMAIN_HOME/bin/setDomainEnv.sh
>>>java weblogic.WLST createDBStore.py
import sys
from java.util import *
from javax.management import *
from java.io import FileInputStream
print "@@@ creating JDBC persistence stores ..."
propInputStream1 = FileInputStream("jms.properties")
domainProps = util.Properties()
domainProps.load(propInputStream1)
adminURL='t3://'+domainProps.get('adminServer')+':'+domainProps.get('adminPort')
adminUserName='weblogic'
adminPassword=domainProps.get("adminPassword")
clusterName=domainProps.get('clusterName')
dataSourceName=domainProps.get("dataSourceName")
try:
connect(adminUserName, adminPassword, adminURL)
edit()
startEdit()
###################Create JDBC Stores for cluster####################
cd('Clusters/'+clusterName)
managedServers=cmo.getServers()
i = 1
for managedServer in managedServers:
managedServerName=managedServer.getName()
cd('/')
cmo.createJDBCStore('JDBCStore_'+str(i))
cd('/JDBCStores/JDBCStore_'+str(i))
cmo.setDataSource(getMBean('/SystemResources/'+dataSourceName))
cmo.setPrefixName('JMS'+str(i))
msObjectName='com.bea:Name='+managedServerName+',Type=Server'
set('Targets',jarray.array([ObjectName(msObjectName)], ObjectName))
print "@@@ created JDBC persistence store"
i = i + 1
print "@@@ script completed"
save()
activate()
except:
print "@@@ exception in wlst script"
dumpStack()
No comments:
Post a Comment