Examples of ApplicationResource


Examples of bibliothek.gui.dock.support.util.ApplicationResource

                control.intern().getController().setTheme( theme );
            }
        });
       
        try {
            control.getResources().put( "dock.ui.ThemeMap", new ApplicationResource(){
                public void read( DataInputStream in ) throws IOException {
                    Version.read( in ).checkCurrent();
                    if( in.readBoolean() ){
                        select( in.readUTF() );
                    }
View Full Code Here

Examples of bibliothek.gui.dock.support.util.ApplicationResource

     */
    protected void initPersistentStorage(){
        try{
          addMultipleDockableFactory( "", NullMultipleCDockableFactory.NULL, false );
         
            resources.put( "ccontrol.frontend", new ApplicationResource(){
                public void write( DataOutputStream out ) throws IOException {
                    Version.write( out, Version.VERSION_1_1_1 );
                    frontend.write( out );
                }
                public void read( DataInputStream in ) throws IOException {
                    Version version = Version.read( in );
                    version.checkCurrent();
                    if( Version.VERSION_1_1_1.compareTo( version ) > 0 && Version.VERSION_1_0_4.compareTo( version ) <= 0 ){
                      readWorkingAreas( in );
                    }
                    frontend.read( in );
                }
                public void writeXML( XElement element ) {
                    frontend.writeXML( element.addElement( "frontend" ) );
                }
                public void readXML( XElement element ) {
                    frontend.readXML( element.getElement( "frontend" ) );
                }
            });

            resources.put( "ccontrol.preferences", new ApplicationResource(){
                public void read( DataInputStream in ) throws IOException {
                    Version version = Version.read( in );
                    version.checkCurrent();
                    preferences.read( in );

View Full Code Here

Examples of bibliothek.gui.dock.support.util.ApplicationResource

        super( null, list );
        control.addDestroyHook( this );
        dockableCollector = new DockableCollector( control.intern() );
        getList().addComponentCollector( dockableCollector );
        try {
            control.getResources().put( "CLookAndFeelMenuPiece", new ApplicationResource(){
                public void write( DataOutputStream out ) throws IOException {
                    Version.write( out, Version.VERSION_1_0_4 );
                    getList().write( out );
                }
                public void read( DataInputStream in ) throws IOException {
View Full Code Here

Examples of com.googlecode.psiprobe.model.ApplicationResource

            try {
                Set dsNames = server.queryNames(new ObjectName("jboss.jca:service=ManagedConnectionPool,*"), null);
                for (Iterator it = dsNames.iterator(); it.hasNext();) {
                    ObjectName managedConnectionPoolOName = (ObjectName) it.next();

                    ApplicationResource resource = new ApplicationResource();
                    resource.setName(managedConnectionPoolOName.getKeyProperty("name"));
                    resource.setType("jboss");
                    String criteria = (String) server.getAttribute(managedConnectionPoolOName, "Criteria");
                    if ("ByApplication".equals(criteria)) {
                        resource.setAuth("Application");
                    } else if ("ByContainerAndApplication".equals(criteria)) {
                        resource.setAuth("Both");
                    } else {
                        resource.setAuth("Container");
                    }
                    DataSourceInfo dsInfo = new DataSourceInfo();
                    dsInfo.setMaxConnections(((Integer) server.getAttribute(managedConnectionPoolOName, "MaxSize")).intValue());
                    dsInfo.setEstablishedConnections(((Integer) server.getAttribute(managedConnectionPoolOName, "ConnectionCount")).intValue());
                    dsInfo.setBusyConnections(((Long) server.getAttribute(managedConnectionPoolOName, "InUseConnectionCount")).intValue());


                    ObjectName connectionFactoryOName = new ObjectName("jboss.jca:service=ManagedConnectionFactory,name=" + resource.getName());
                    Element elm = (Element) server.getAttribute(connectionFactoryOName, "ManagedConnectionFactoryProperties");

                    if (elm != null) {
                        NodeList nl = elm.getChildNodes();
                        for (int i = 0; i < nl.getLength(); i++) {
                            Node n = nl.item(i);
                            Node na = n.getAttributes().getNamedItem("name");
                            if (na != null) {
                                if ("ConnectionURL".equals(na.getNodeValue())) {
                                    dsInfo.setJdbcURL(n.getFirstChild().getNodeValue());
                                }

                                if ("UserName".equals(na.getNodeValue())) {
                                    dsInfo.setUsername(n.getFirstChild().getNodeValue());
                                }

                                //
                                // JMS datasource
                                //
                                if ("JmsProviderAdapterJNDI".equals(na.getNodeValue())) {
                                    dsInfo.setJdbcURL(n.getFirstChild().getNodeValue());
                                    resource.setType("jms");
                                }
                            }
                        }
                    }

                    dsInfo.setResettable(true);

                    resource.setDataSourceInfo(dsInfo);
                    resources.add(resource);
                }
            } catch (Exception e) {
                //
                logger.fatal("There was an error querying JBoss JMX server:", e);
View Full Code Here

Examples of com.googlecode.psiprobe.model.ApplicationResource

        if (server != null) {
            try {
                Set dsNames = server.queryNames(new ObjectName("Catalina:type=Resource,resourcetype=Global,*"), null);
                for (Iterator it = dsNames.iterator(); it.hasNext();) {
                    ObjectName objectName = (ObjectName) it.next();
                    ApplicationResource resource = new ApplicationResource();

                    logger.info("reading resource: " + objectName);
                    resource.setName(getStringAttribute(server, objectName, "name"));
                    resource.setType(getStringAttribute(server, objectName, "type"));
                    resource.setScope(getStringAttribute(server, objectName, "scope"));
                    resource.setAuth(getStringAttribute(server, objectName, "auth"));
                    resource.setDescription(getStringAttribute(server, objectName, "description"));

                    lookupResource(resource, true, true);

                    resources.add(resource);
                }
View Full Code Here

Examples of com.googlecode.psiprobe.model.ApplicationResource

            try {
                ContextResource[] resources = context.getNamingResources().findResources();
                for (int i = 0; i < resources.length; i++) {
                    ContextResource contextResource = resources[i];
                    ApplicationResource resource = new ApplicationResource();

                    logger.info("reading resource: " + contextResource.getName());
                    resource.setApplicationName(context.getName());
                    resource.setName(contextResource.getName());
                    resource.setType(contextResource.getType());
                    resource.setScope(contextResource.getScope());
                    resource.setAuth(contextResource.getAuth());
                    resource.setDescription(contextResource.getDescription());

                    lookupResource(resource, contextBound, false);

                    resourceList.add(resource);
                }

                ContextResourceLink[] resourceLinks = context.getNamingResources().findResourceLinks();
                for (int i = 0; i < resourceLinks.length; i++) {
                    ContextResourceLink link = resourceLinks[i];

                    ApplicationResource resource = new ApplicationResource();
                    logger.debug("reading resourceLink: " + link.getName());
                    resource.setApplicationName(context.getName());
                    resource.setName(link.getName());
                    resource.setType(link.getType());
                    resource.setLinkTo(link.getGlobal());

                    lookupResource(resource, contextBound, false);
                   
                    resourceList.add(resource);
                }
View Full Code Here

Examples of com.googlecode.psiprobe.model.ApplicationResource

        if (containerWrapper == null) {
            logger.error("Cannot collect data source stats. Container wrapper is not set.");
        } else {
            List dataSources = getContainerWrapper().getDataSources();
            for (int i = 0; i < dataSources.size(); i++) {
                ApplicationResource ds = (ApplicationResource) dataSources.get(i);
                String appName = ds.getApplicationName();
                String name = (appName == null ? "" : appName) + "/" + ds.getName();
                DataSourceInfo dsi = ds.getDataSourceInfo();
                int numEstablished = dsi.getEstablishedConnections();
                int numBusy = dsi.getBusyConnections();
                logger.trace("Collecting stats for datasource: " + name);
                buildAbsoluteStats(PREFIX_ESTABLISHED + name, numEstablished, currentTime);
                buildAbsoluteStats(PREFIX_BUSY + name, numBusy, currentTime);
View Full Code Here

Examples of com.googlecode.psiprobe.model.ApplicationResource

        if (containerWrapper == null) {
            logger.error("Cannot reset application stats. Container wrapper is not set.");
        } else {
            List dataSources = getContainerWrapper().getDataSources();
            for (int i = 0; i < dataSources.size(); i++) {
                ApplicationResource ds = (ApplicationResource) dataSources.get(i);
                reset(ds.getName());
            }
        }
    }
View Full Code Here

Examples of com.googlecode.psiprobe.model.ApplicationResource

        return resources;
    }

    protected void filterDataSources(List resources, List dataSources) {
        for (Iterator it = resources.iterator(); it.hasNext(); ) {
            ApplicationResource res = (ApplicationResource) it.next();
            if (res.getDataSourceInfo() != null) {
                dataSources.add(res);
            }
        }
    }
View Full Code Here

Examples of com.googlecode.psiprobe.model.ApplicationResource

                List applicationResources = getContainerWrapper().getResourceResolver().getApplicationResources(appContext);

                for (Iterator it2 = applicationResources.iterator(); it2.hasNext();) {

                    ApplicationResource appResource = (ApplicationResource) it2.next();

                    DataSourceInfo dsi = appResource.getDataSourceInfo();
                    if (dsi != null && dsi.getBusyScore() > tomcatTestReport.getDatasourceUsageScore()) {
                        tomcatTestReport.setContextName(appContext.getName());
                        tomcatTestReport.setDatasourceUsageScore(dsi.getBusyScore());
                        tomcatTestReport.setDataSourceName(appResource.getName());
                    }
                }
            }

            tomcatTestReport.setWebappAvailabilityTest(allContextsAvailable ?
                    TomcatTestReport.TEST_PASSED : TomcatTestReport.TEST_FAILED);

        } else {
            List l = getContainerWrapper().getResourceResolver().getApplicationResources();
            for (int i = 0; i < l.size(); i++) {
                ApplicationResource resource = (ApplicationResource)l.get(i);
                DataSourceInfo dsi = resource.getDataSourceInfo();
                if (dsi != null && dsi.getBusyScore() > tomcatTestReport.getDatasourceUsageScore()) {
                    tomcatTestReport.setDatasourceUsageScore(dsi.getBusyScore());
                    tomcatTestReport.setDataSourceName(resource.getName());
                }
            }
        }
        tomcatTestReport.setDatasourceTest(TomcatTestReport.TEST_PASSED);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.