当前位置: 首页>>代码示例>>Java>>正文


Java MBeanRegistrationException类代码示例

本文整理汇总了Java中javax.management.MBeanRegistrationException的典型用法代码示例。如果您正苦于以下问题:Java MBeanRegistrationException类的具体用法?Java MBeanRegistrationException怎么用?Java MBeanRegistrationException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MBeanRegistrationException类属于javax.management包,在下文中一共展示了MBeanRegistrationException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerMBean

import javax.management.MBeanRegistrationException; //导入依赖的package包/类
public static void registerMBean(final String mBeanObjectName,final Object mBean)
{
   try
   {
      final ObjectName name = new ObjectName(mBeanObjectName);
      mbs.registerMBean(mBean, name);
   }
   catch (MalformedObjectNameException badObjectName)
   {
 	  logger.error(badObjectName.getMessage());
   }
   catch (InstanceAlreadyExistsException duplicateMBeanInstance)
   {
 	  logger.error(duplicateMBeanInstance.getMessage());
   }
   catch (MBeanRegistrationException mbeanRegistrationProblem)
   {
 	  logger.error(mbeanRegistrationProblem.getMessage());
   }
   catch (NotCompliantMBeanException badMBean)
   {
 	  logger.error(badMBean.getMessage());
   }
}
 
开发者ID:vaimee,项目名称:sepatools,代码行数:25,代码来源:SEPABeans.java

示例2: init

import javax.management.MBeanRegistrationException; //导入依赖的package包/类
public boolean init() throws MalformedObjectNameException, InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException, FileNotFoundException, NoSuchElementException, IOException {			
	//Initialize SPARQL 1.1 processing service properties
	endpointProperties = new SPARQL11Properties("endpoint.jpar");
	
	//Initialize SPARQL 1.1 SE processing service properties
	engineProperties = new EngineProperties("engine.jpar");
	
	//SPARQL 1.1 SE request processor
	processor = new Processor(endpointProperties);
	
	//SPARQL 1.1 SE request scheduler
	scheduler = new Scheduler(engineProperties,processor);
	
	//SPARQL 1.1 Protocol handlers
	httpGate = new HTTPGate(engineProperties,scheduler);
	httpsGate = new HTTPSGate(engineProperties,scheduler,am);
	
	//SPARQL 1.1 SE Protocol handler for WebSocket based subscriptions
	websocketApp = new WSGate(engineProperties,scheduler);
	secureWebsocketApp = new WSSGate(engineProperties,scheduler,am);
	        
       return true;
}
 
开发者ID:vaimee,项目名称:sepatools,代码行数:24,代码来源:Engine.java

示例3: preRegister

import javax.management.MBeanRegistrationException; //导入依赖的package包/类
private static ObjectName preRegister(
        DynamicMBean mbean, MBeanServer mbs, ObjectName name)
        throws InstanceAlreadyExistsException, MBeanRegistrationException {

    ObjectName newName = null;

    try {
        if (mbean instanceof MBeanRegistration)
            newName = ((MBeanRegistration) mbean).preRegister(mbs, name);
    } catch (Throwable t) {
        throwMBeanRegistrationException(t, "in preRegister method");
    }

    if (newName != null) return newName;
    else return name;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:DefaultMBeanServerInterceptor.java

示例4: addDynamicMBean

import javax.management.MBeanRegistrationException; //导入依赖的package包/类
/**
 * Registers a DynamicMBean.
 */
private static void addDynamicMBean(final MBeanServer mbs,
                                    final DynamicMBean dmbean,
                                    final ObjectName on) {
    try {
        AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
            @Override
            public Void run() throws InstanceAlreadyExistsException,
                                     MBeanRegistrationException,
                                     NotCompliantMBeanException {
                mbs.registerMBean(dmbean, on);
                return null;
            }
        });
    } catch (PrivilegedActionException e) {
        throw new RuntimeException(e.getException());
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:ManagementFactory.java

示例5: createMBean

import javax.management.MBeanRegistrationException; //导入依赖的package包/类
public ObjectInstance createMBean(String className, ObjectName name,
                                  Object[] params, String[] signature)
    throws ReflectionException, InstanceAlreadyExistsException,
           MBeanRegistrationException, MBeanException,
           NotCompliantMBeanException  {

    try {
        return createMBean(className, name, null, true,
                           params, signature);
    } catch (InstanceNotFoundException e) {
        /* Can only happen if loaderName doesn't exist, but we just
           passed null, so we shouldn't get this exception.  */
        throw EnvHelp.initCause(
            new IllegalArgumentException("Unexpected exception: " + e), e);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:DefaultMBeanServerInterceptor.java

示例6: registerMBean

import javax.management.MBeanRegistrationException; //导入依赖的package包/类
public ObjectInstance registerMBean(Object object, ObjectName name)
    throws InstanceAlreadyExistsException, MBeanRegistrationException,
    NotCompliantMBeanException  {

    // ------------------------------
    // ------------------------------
    Class<?> theClass = object.getClass();

    Introspector.checkCompliance(theClass);

    final String infoClassName = getNewMBeanClassName(object);

    checkMBeanPermission(infoClassName, null, name, "registerMBean");
    checkMBeanTrustPermission(theClass);

    return registerObject(infoClassName, object, name);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:DefaultMBeanServerInterceptor.java

示例7: doTest

import javax.management.MBeanRegistrationException; //导入依赖的package包/类
private void doTest(JMXConnector connector) throws IOException,
MalformedObjectNameException, ReflectionException,
InstanceAlreadyExistsException, MBeanRegistrationException,
MBeanException, NotCompliantMBeanException, InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException {
    MBeanServerConnection  mbsc = connector.getMBeanServerConnection();


    ObjectName objName = new ObjectName("com.redhat.test.jmx:type=NameMBean");
    System.out.println("DEBUG: Calling createMBean");
    mbsc.createMBean(Name.class.getName(), objName);

    System.out.println("DEBUG: Calling setAttributes");
    AttributeList attList = new AttributeList();
    attList.add(new Attribute("FirstName", ANY_NAME));
    attList.add(new Attribute("LastName", ANY_NAME));
    mbsc.setAttributes(objName, attList);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:18,代码来源:RMIConnectorLogAttributesTest.java

示例8: createMBean

import javax.management.MBeanRegistrationException; //导入依赖的package包/类
/**
 * Call <code>checkCreate(className)</code>, then forward this method to the
 * wrapped object.
 */
public ObjectInstance createMBean(String className, ObjectName name)
    throws
    ReflectionException,
    InstanceAlreadyExistsException,
    MBeanRegistrationException,
    MBeanException,
    NotCompliantMBeanException {
    checkCreate(className);
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        Object object = getMBeanServer().instantiate(className);
        checkClassLoader(object);
        return getMBeanServer().registerMBean(object, name);
    } else {
        return getMBeanServer().createMBean(className, name);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:MBeanServerAccessController.java

示例9: createMBean

import javax.management.MBeanRegistrationException; //导入依赖的package包/类
/**
 * Call <code>checkCreate(className)</code>, then forward this method to the
 * wrapped object.
 */
public ObjectInstance createMBean(String className,
                                  ObjectName name,
                                  ObjectName loaderName)
    throws
    ReflectionException,
    InstanceAlreadyExistsException,
    MBeanRegistrationException,
    MBeanException,
    NotCompliantMBeanException,
    InstanceNotFoundException {
    checkCreate(className);
    SecurityManager sm = System.getSecurityManager();
    if (sm == null) {
        Object object = getMBeanServer().instantiate(className,
                                                     loaderName);
        checkClassLoader(object);
        return getMBeanServer().registerMBean(object, name);
    } else {
        return getMBeanServer().createMBean(className, name, loaderName);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:MBeanServerAccessController.java

示例10: throwMBeanRegistrationException

import javax.management.MBeanRegistrationException; //导入依赖的package包/类
private static void throwMBeanRegistrationException(Throwable t, String where)
throws MBeanRegistrationException {
    if (t instanceof RuntimeException) {
        throw new RuntimeMBeanException((RuntimeException)t,
                "RuntimeException thrown " + where);
    } else if (t instanceof Error) {
        throw new RuntimeErrorException((Error)t,
                "Error thrown " + where);
    } else if (t instanceof MBeanRegistrationException) {
        throw (MBeanRegistrationException)t;
    } else if (t instanceof Exception) {
        throw new MBeanRegistrationException((Exception)t,
                "Exception thrown " + where);
    } else // neither Error nor Exception??
        throw new RuntimeException(t);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:17,代码来源:DefaultMBeanServerInterceptor.java

示例11: unregisterMBean

import javax.management.MBeanRegistrationException; //导入依赖的package包/类
public void unregisterMBean(ObjectName name)
throws InstanceNotFoundException,
        MBeanRegistrationException,
        IOException {
    if (logger.debugOn())
        logger.debug("unregisterMBean", "name=" + name);

    final ClassLoader old = pushDefaultClassLoader();
    try {
        connection.unregisterMBean(name, delegationSubject);
    } catch (IOException ioe) {
        communicatorAdmin.gotIOException(ioe);

        connection.unregisterMBean(name, delegationSubject);
    } finally {
        popDefaultClassLoader(old);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:RMIConnector.java

示例12: Scheduler

import javax.management.MBeanRegistrationException; //导入依赖的package包/类
public Scheduler(EngineProperties properties,Processor processor) throws MalformedObjectNameException, InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
	requestHandler = new RequestResponseHandler(properties);
	tokenHandler = new TokenHandler(properties);
	
	if (processor == null) logger.error("Processor is null");
	else {
		this.processor = processor;
		this.processor.addObserver(this);
	}
}
 
开发者ID:vaimee,项目名称:sepatools,代码行数:11,代码来源:Scheduler.java

示例13: main

import javax.management.MBeanRegistrationException; //导入依赖的package包/类
public static void main(String[] args) throws MalformedObjectNameException, InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException, FileNotFoundException, NoSuchElementException, IOException {
	System.out.println("##########################################################################################");
	System.out.println("# SEPA Engine Ver 0.6  Copyright (C) 2016-2017                                           #");
	System.out.println("# University of Bologna (Italy)                                                          #");
	System.out.println("#                                                                                        #");
	System.out.println("# This program comes with ABSOLUTELY NO WARRANTY                                         #");                                    
	System.out.println("# This is free software, and you are welcome to redistribute it under certain conditions #");
	System.out.println("# GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007                                    #");
	System.out.println("#                                                                                        #");
	System.out.println("# GitHub: https://github.com/vaimee/sepatools                                            #");
	System.out.println("# Web: http://wot.arces.unibo.it                                                         #");
	System.out.println("##########################################################################################");
	System.out.println("");		
	System.out.println("Dependencies");
	System.out.println("com.google.code.gson          2.8.0       Apache 2.0");
	System.out.println("com.nimbusds                  4.34.2      The Apache Software License, Version 2.0");
	System.out.println("commons-io                    2.5         Apache License, Version 2.0");
	System.out.println("commons-logging               1.2         The Apache Software License, Version 2.0");
	System.out.println("org.apache.httpcomponents     4.5.3       Apache License, Version 2.0");
	System.out.println("org.apache.httpcomponents     4.4.6       Apache License, Version 2.0");
	System.out.println("org.apache.logging.log4j      2.8.1       Apache License, Version 2.0");
	System.out.println("org.bouncycastle              1.56        Bouncy Castle Licence");
	System.out.println("org.eclipse.paho              1.1.1       Eclipse Public License - Version 1.0");
	System.out.println("org.glassfish.grizzly         2.3.30      CDDL+GPL");
	System.out.println("org.glassfish.tyrus.bundles   1.13.1      Dual license consisting of the CDDL v1.1 and GPL v2");
	System.out.println("org.jdom                      2.0.6       Similar to Apache License but with the acknowledgment clause removed");
	System.out.println("");
	
	//Engine creation and initialization
	Engine engine = new Engine();
	engine.init();
	
	//Starting main engine thread
	engine.start();
}
 
开发者ID:vaimee,项目名称:sepatools,代码行数:36,代码来源:Engine.java

示例14: JMXFlagDecorator

import javax.management.MBeanRegistrationException; //导入依赖的package包/类
/**
 * 
 * @param flag Flag to be exposed through JMX.
 * @param source MBean or ObjectName of the object where the flag resides.
 * @param nbs NotificationBroadcasterSupport through which the events will be send.
 */
public JMXFlagDecorator(Flag<T> flag, ObjectName source, MBeanServer mbs, String flagName) throws MalformedObjectNameException, InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
    this.flag = flag;
    this.source = source;
    this.flagName = flagName;
    ObjectName name = PogamutJMX.getObjectName(source, flagName, PogamutJMX.FLAGS_SUBTYPE);
    mbs.registerMBean(this, name);
    flag.addListener(listener);
}
 
开发者ID:kefik,项目名称:Pogamut3,代码行数:15,代码来源:JMXFlagDecorator.java

示例15: handleNotification

import javax.management.MBeanRegistrationException; //导入依赖的package包/类
@Override
public void handleNotification(final Notification notification, final Object handback) {
    if (notification instanceof MBeanServerNotification
            && notification.getType().equals(MBeanServerNotification.UNREGISTRATION_NOTIFICATION)
            && ((MBeanServerNotification) notification).getMBeanName().equals(objectNameInternal)) {
        try {
            internalServer.unregisterMBean(objectNameInternal);
            configMBeanServer.removeNotificationListener(MBeanServerDelegate.DELEGATE_NAME, this);
        } catch (MBeanRegistrationException | ListenerNotFoundException | InstanceNotFoundException e) {
            throw new IllegalStateException(e);
        }
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:14,代码来源:AbstractDynamicWrapper.java


注:本文中的javax.management.MBeanRegistrationException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。