Esempio n. 1
0
from library.tomcat.tomcatLib import getConnection, getDomainList, \
    getObjectNames


remoteServerConnection = getConnection("localhost", "8004")

domainList = getDomainList(remoteServerConnection)

for domain in domainList:
    print 'Domain:' + domain
    objectNames = getObjectNames(remoteServerConnection, domain)
    for name in objectNames:
        print ' Object Name:' + name.toString()
        mInfo = remoteServerConnection.getMBeanInfo(name)
        mBeanAttrs = mInfo.getAttributes()
        for attr in mBeanAttrs :
            if (attr.isWritable()) :
                print '  Attribute: ' + attr.getName() + ', type: ' + str(attr.getType()) + ', ' + name.toString() + ': is Writable'                        
from library.tomcat.tomcatLib import getConnection, getDomainList, \
    getObjectNames, getParameterValue
from library.util import appendToFile, writeToFile, mkdir_p


host = "localhost"
port = "8004"
username = ""
password = ""

mkdir_p("./autoGen")
auditAtomFile = "./autoGen/CodeGen.AuditAtomsWritable.py"
auditPropertyFile = "./autoGen/CodeGen.PropertiesWritable.py"

remoteServerConnection = getConnection(host, port)

domainList = getDomainList(remoteServerConnection)

writeToFile("\n", auditAtomFile) # reset file
writeToFile("\n", auditPropertyFile) # reset file

for domain in domainList:
    
    print "# Code generation. Copy AuditAtoms generated into your code.\n"
    print '# Domain:' + domain
    appendToFile("# Code generation. Copy AuditAtoms generated into your code.\n", auditAtomFile)
    appendToFile('# Domain:' + domain + "\n", auditAtomFile)
    objectNames = getObjectNames(remoteServerConnection, domain)
    
    for objectName in objectNames: