Package org.apache.karaf.eik.workbench.jmx

Examples of org.apache.karaf.eik.workbench.jmx.JMXServiceDescriptor


        });
    }

    private IPath getKarafPlatformRootPath(final MBeanProvider service) {
        final JMXServiceDescriptor jmxServiceDescriptor = service.getJMXServiceDescriptor();
        final KarafPlatformModel karafPlatformModel =
            (KarafPlatformModel) jmxServiceDescriptor.getAdapter(KarafPlatformModel.class);

        if (karafPlatformModel == null) {
            return new Path("");
        }
View Full Code Here


        final MBeanServerConnectionJob mbeanConnectionJob;
        try {
            final JMXServiceURL standardJmxConnection = new JMXServiceURL(
                    "service:jmx:rmi:///jndi/rmi://localhost:" + jmxPort + "/jmxrmi"); //$NON-NLS-1$ $NON-NLS-2$

            final JMXServiceDescriptor descriptor = new LocalJMXServiceDescriptor(
                        configuration.getName(),
                        platformModel,
                        standardJmxConnection,
                        null,
                        null,
                        JMX_JMXRMI_DOMAIN);

            mbeanConnectionJob = new MBeanServerConnectionJob(configuration.getName(), descriptor);

            mbeanProviderDataMap.get(memento).setMbeanConnectionJob(mbeanConnectionJob);
            mbeanProviderDataMap.get(memento).setJmxServiceDescriptor(descriptor);

            jmxServiceManager.add(descriptor);
        } catch(final MalformedURLException e) {
            KarafWorkbenchActivator.getLogger().error("Unable to connect to JMX endpoint on Karaf instance", e);

            throw new CoreException(new Status(IStatus.ERROR, "", "")); //$NON-NLS-1$ $NON-NLS-2$
        }

        final IJobChangeListener listener = new JobChangeAdapter() {
            @Override
            public void done(final IJobChangeEvent event) {
                final IStatus result = event.getResult();
                if (result == null || !result.isOK()) {
                    // TODO: Log something
                    return;
                }

                if (!mbeanConnectionJob.isConnected()) {
                    // TODO: Log something
                    return;
                }

                final KarafMBeanProvider mbeanProvider;
                try {
                    final JMXServiceDescriptor jmxServiceDescriptor = mbeanProviderDataMap.get(memento).getJmxServiceDescriptor();
                    mbeanProvider = new LocalKarafMBeanProvider(jmxServiceDescriptor, mbeanConnectionJob.getJmxClient(), platformModel);
                    mbeanProvider.open(memento);

                    mbeanProviderDataMap.get(memento).setMbeanProvider(mbeanProvider);
                    mbeanProviderManager.add(mbeanProvider);
View Full Code Here

                for (final DebugEvent event : events) {
                    if (   process != null
                        && process.equals(event.getSource())
                        && event.getKind() == DebugEvent.TERMINATE)
                    {
                        final JMXServiceDescriptor descriptor = mbeanProviderDataMap.get(memento).getJmxServiceDescriptor();
                        jmxServiceManager.remove(descriptor);

                        final MBeanServerConnectionJob job = mbeanProviderDataMap.get(memento).getMBeanServerConnectionJob();
                        if (job != null) {
                            job.cancel();
View Full Code Here

        @Override
        public void launchRemoved(final ILaunch launch) {
            try {
                final String memento = launch.getLaunchConfiguration().getMemento();

                final JMXServiceDescriptor jmxServiceDescriptor = mbeanProviderDataMap.get(memento).getJmxServiceDescriptor();

                if (jmxServiceDescriptor == null) {
                    return;
                }
View Full Code Here

            throw new AssertionError(e);
        }
    }

    private IPath getKarafPlatformRootPath(final MBeanProvider service) {
        final JMXServiceDescriptor jmxServiceDescriptor = service.getJMXServiceDescriptor();
        final KarafPlatformModel karafPlatformModel =
            (KarafPlatformModel) jmxServiceDescriptor.getAdapter(KarafPlatformModel.class);

        if (karafPlatformModel == null) {
            return new Path("");
        }
View Full Code Here

TOP

Related Classes of org.apache.karaf.eik.workbench.jmx.JMXServiceDescriptor

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.