Package javax.management

Examples of javax.management.ObjectName$Property


        StringBuffer url = request.getRequestURL().replace(index, request.getRequestURL().length(), newContext);
        applicationController.subscribeUserAndCreateStatistic(Long.valueOf(applicationVersionId), request);

        String itmsURL = "itms-services://?action=download-manifest&url=" + url.toString();

        Property property = new Property();
        property.setKey("URL");
        property.setValue(itmsURL);

        return property;
    }
View Full Code Here


    @RequestMapping(value = "/statistics", method = RequestMethod.GET, produces = contentType)
    public
    @ResponseBody
    Properties viewSystemManagementPage(HttpServletRequest request) {
        Property[] properties = new Property[3];
        properties[0] = new Property(SystemStatistics.ORGANIZATION_COUNT.name(), Long.toString(organizationService.countAll()), SystemStatistics.ORGANIZATION_COUNT.getDescription());
        properties[1] = new Property(SystemStatistics.USER_COUNT.name(), Long.toString(userService.countAll()), SystemStatistics.USER_COUNT.getDescription());
        properties[2] = new Property(SystemStatistics.APPLICATION_COUNT.name(), Long.toString(applicationService.countAll()), SystemStatistics.APPLICATION_COUNT.getDescription());

        Properties props = new Properties();
        props.setProperties(properties);

        return props;
View Full Code Here

      invokeMainDeployer("undeploy", url);
   }

   private void invokeMainDeployer(String methodName, URL url) throws Exception {
       //System.out.println("INVOKE MAIN DEPLOYER: "+methodName+" URL="+url);
         server.invoke(new ObjectName(MAIN_DEPLOYER), methodName, new Object[] { url }, new String[] { "java.net.URL" });
   }
View Full Code Here

    }

    private static void setupMonitor(IoAcceptor service) {
        final MBeanServer server = ManagementFactory.getPlatformMBeanServer();
        try {
            server.registerMBean(new IoServiceMBean(service), new ObjectName("org.apache.mina:type=service,name="
                    + SRV_NAME));
        } catch (InstanceAlreadyExistsException iaee) {
            throw new IllegalStateException(iaee);
        } catch (MBeanRegistrationException mre) {
            throw new IllegalStateException(mre);
View Full Code Here

        List resources = new ArrayList();

        MBeanServer server = getMBeanServer();
        if (server != null) {
            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++) {
View Full Code Here

        return new ArrayList();
    }

    public boolean resetResource(Context context, String resourceName) throws NamingException {
        try {
            ObjectName poolOName = new ObjectName("jboss.jca:service=ManagedConnectionPool,name="+resourceName);
            MBeanServer server = getMBeanServer();
            if (server != null) {
                try {
                    server.invoke(poolOName, "stop", null, null);
                    server.invoke(poolOName, "start", null, null);
View Full Code Here

 
 
  private static Collection<ConfigPropertyMetaData> getRarProperties(String rarName){
    try {
      MBeanServer server = MBeanServerFactory.findMBeanServer(null).get(0);
      ObjectName on = new ObjectName("jboss.jca:service=RARDeployment,name='"+rarName+"'");//$NON-NLS-1$  //$NON-NLS-2$ 
      ConnectorMetaData obj = (ConnectorMetaData)server.getAttribute(on, "MetaData");//$NON-NLS-1$ 
      ConnectionDefinitionMetaData metadata = obj.getConnectionDefinition(ConnectionFactory.class.getName());
      if (metadata != null) {
        return metadata.getProperties();
      }
View Full Code Here

  private boolean shutdownInProgress = false;
 
  public JBossLifeCycleListener() {
    try {
      MBeanServer server = MBeanServerFactory.findMBeanServer(null).get(0);
      ObjectName on = new ObjectName("jboss.system:type=Server"); //$NON-NLS-1$
      server.addNotificationListener(on, this, null, null);
    } catch (MalformedObjectNameException e) {
      //ignore
    } catch (InstanceNotFoundException e) {
      //ignore
View Full Code Here

    public Cluster getCluster(String serverName, String hostName, boolean loadMembers) throws Exception {
        Cluster cluster = null;

        MBeanServer mBeanServer = new Registry().getMBeanServer();
        ObjectName membershipOName = new ObjectName(serverName +":type=ClusterMembership,host=" + hostName);
        ObjectName receiverOName = new ObjectName(serverName +":type=ClusterReceiver,host=" + hostName);
        ObjectName senderOName = new ObjectName(serverName +":type=ClusterSender,host=" + hostName);

        //
        // should be just one set, this is just to find out if this instance
        // is cluster-enabled and the cluster supports JMX
        //
        Set clusters = mBeanServer.queryMBeans(new ObjectName("*:type=Cluster,host=" + hostName), null);
        Set membership = mBeanServer.queryMBeans(membershipOName, null);
        if (clusters != null && clusters.size() > 0 && membership != null && membership.size() > 0) {
            ObjectName clusterOName = ((ObjectInstance) clusters.iterator().next()).getObjectName();
            cluster = new Cluster();

            cluster.setName(JmxTools.getStringAttr(mBeanServer, clusterOName, "clusterName"));
            cluster.setInfo(JmxTools.getStringAttr(mBeanServer, clusterOName, "info"));
            cluster.setManagerClassName(JmxTools.getStringAttr(mBeanServer, clusterOName, "managerClassName"));

            cluster.setMcastAddress(JmxTools.getStringAttr(mBeanServer, membershipOName, "mcastAddr"));
            cluster.setMcastBindAddress(JmxTools.getStringAttr(mBeanServer, membershipOName, "mcastBindAddress"));
            cluster.setMcastClusterDomain(JmxTools.getStringAttr(mBeanServer, membershipOName, "mcastClusterDomain"));
            cluster.setMcastDropTime(JmxTools.getLongAttr(mBeanServer, membershipOName, "mcastDropTime"));
            cluster.setMcastFrequency(JmxTools.getLongAttr(mBeanServer, membershipOName, "mcastFrequency"));
            cluster.setMcastPort(JmxTools.getIntAttr(mBeanServer, membershipOName, "mcastPort"));
            cluster.setMcastSoTimeout(JmxTools.getIntAttr(mBeanServer, membershipOName, "mcastSoTimeout"));
            cluster.setMcastTTL(JmxTools.getIntAttr(mBeanServer, membershipOName, "mcastTTL"));

            cluster.setTcpListenAddress(JmxTools.getStringAttr(mBeanServer, receiverOName, "tcpListenAddress"));
            cluster.setTcpListenPort(JmxTools.getIntAttr(mBeanServer, receiverOName, "tcpListenPort"));
            cluster.setNrOfMsgsReceived(JmxTools.getLongAttr(mBeanServer, receiverOName, "nrOfMsgsReceived"));
            cluster.setTotalReceivedBytes(JmxTools.getLongAttr(mBeanServer, receiverOName, "totalReceivedBytes"));
//            cluster.setTcpSelectorTimeout(getLongAttr(mBeanServer, receiverOName, "tcpSelectorTimeout"));
//            cluster.setTcpThreadCount(getIntAttr(mBeanServer, receiverOName, "tcpThreadCount"));

            cluster.setSenderAckTimeout(JmxTools.getLongAttr(mBeanServer, senderOName, "ackTimeout"));
            cluster.setSenderAutoConnect(((Boolean) mBeanServer.getAttribute(senderOName, "autoConnect")).booleanValue());
            cluster.setSenderFailureCounter(JmxTools.getLongAttr(mBeanServer, senderOName, "failureCounter"));
            cluster.setSenderNrOfRequests(JmxTools.getLongAttr(mBeanServer, senderOName, "nrOfRequests"));
            cluster.setSenderReplicationMode(JmxTools.getStringAttr(mBeanServer, senderOName, "replicationMode"));
            cluster.setSenderTotalBytes(JmxTools.getLongAttr(mBeanServer, senderOName, "totalBytes"));

            if (loadMembers) {
                ObjectName senders[] = (ObjectName[]) mBeanServer.getAttribute(senderOName, "senderObjectNames");
                for (int i = 0; i < senders.length; i++) {

                    ClusterSender sender;

                    if ("pooled".equals(cluster.getSenderReplicationMode())) {
                        sender = new PooledClusterSender();
                    } else if ("synchronous".equals(cluster.getSenderReplicationMode())) {
                        sender = new SyncClusterSender();
                    } else if ("asynchronous".equals(cluster.getSenderReplicationMode()) ||
                            "fastasyncqueue".equals(cluster.getSenderReplicationMode())) {
                        sender = new AsyncClusterSender();
                    } else {
                        sender = new ClusterSender();
                    }
                    ObjectName localSenderOName = senders[i];

                    sender.setAddress(JmxTools.getStringAttr(mBeanServer, localSenderOName, "address"));
                    sender.setPort(JmxTools.getIntAttr(mBeanServer, localSenderOName, "port"));

                    sender.setAvgMessageSize(JmxTools.getLongAttr(mBeanServer, localSenderOName, "avgMessageSize", -1));
View Full Code Here

    /**
     * Handles creation and deletion of new "worker" threads.
     */
    public synchronized void handleNotification(Notification notification, Object object) {
        if (notification instanceof MBeanServerNotification) {
            ObjectName objectName = ((MBeanServerNotification) notification).getMBeanName();

            if (notification.getType().equals(MBeanServerNotification.REGISTRATION_NOTIFICATION)) {

                if ("RequestProcessor".equals(objectName.getKeyProperty("type"))) {
                    ThreadPoolObjectName threadPoolObjectName = findPool(objectName.getKeyProperty("worker"));
                    if (threadPoolObjectName != null) {
                        threadPoolObjectName.getRequestProcessorNames().add(objectName);
                    }
                }

            } else if (notification.getType().equals(MBeanServerNotification.UNREGISTRATION_NOTIFICATION)) {

                if ("RequestProcessor".equals(objectName.getKeyProperty("type"))) {
                    ThreadPoolObjectName threadPoolObjectName = findPool(objectName.getKeyProperty("worker"));
                    if (threadPoolObjectName != null) {
                        threadPoolObjectName.getRequestProcessorNames().remove(objectName);
                    }
                }
            }
View Full Code Here

TOP

Related Classes of javax.management.ObjectName$Property

Copyright © 2018 www.massapicom. 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.