Java 类javax.management.MBeanRegistration 实例源码

项目:lams    文件:BaseModelMBean.java   
/**
     * Is the specified <code>ModelMBeanInfo</code> instance valid?
     *
     * <p><strong>IMPLEMENTATION NOTE</strong> - This implementation
     * does not check anything, but this method can be overridden
     * as required.</p>
     *
     * @param info The <code>ModelMBeanInfo object to check
     */
//    protected boolean isModelMBeanInfoValid(ModelMBeanInfo info) {
//        return (true);
//    }

    // -------------------- Registration  --------------------
    // XXX We can add some method patterns here- like setName() and
    // setDomain() for code that doesn't implement the Registration

    public ObjectName preRegister(MBeanServer server,
                                  ObjectName name)
            throws Exception
    {
        if( log.isDebugEnabled())
            log.debug("preRegister " + resource + " " + name );
        oname=name;
        if( resource instanceof MBeanRegistration ) {
            oname = ((MBeanRegistration)resource).preRegister(server, name );
        }
        return oname;
    }
项目:OpenJSharp    文件:DefaultMBeanServerInterceptor.java   
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;
}
项目:OpenJSharp    文件:DefaultMBeanServerInterceptor.java   
private static void postRegister(
        ObjectName logicalName, DynamicMBean mbean,
        boolean registrationDone, boolean registerFailed) {

    if (registerFailed && mbean instanceof DynamicMBean2)
        ((DynamicMBean2) mbean).registerFailed();
    try {
        if (mbean instanceof MBeanRegistration)
            ((MBeanRegistration) mbean).postRegister(registrationDone);
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Exception thrown by postRegister: " +
                "rethrowing <"+e+">, but keeping the MBean registered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postRegister method: "+
                  "rethrowing <"+e+">, but keeping the MBean registered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Error thrown by postRegister: " +
                "rethrowing <"+er+">, but keeping the MBean registered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postRegister method: "+
                  "rethrowing <"+er+">, but keeping the MBean registered");
    }
}
项目:OpenJSharp    文件:DefaultMBeanServerInterceptor.java   
private static void postDeregisterInvoke(ObjectName mbean,
        MBeanRegistration moi) {
    try {
        moi.postDeregister();
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Exception thrown by postDeregister: " +
                "rethrowing <"+e+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postDeregister method: "+
                  "rethrowing <"+e+
                  ">, although the MBean is sucessfully unregistered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Error thrown by postDeregister: " +
                "rethrowing <"+er+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postDeregister method: "+
                  "rethrowing <"+er+
                  ">, although the MBean is sucessfully unregistered");
    }
}
项目:jdk8u-jdk    文件:DefaultMBeanServerInterceptor.java   
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;
}
项目:jdk8u-jdk    文件:DefaultMBeanServerInterceptor.java   
private static void postRegister(
        ObjectName logicalName, DynamicMBean mbean,
        boolean registrationDone, boolean registerFailed) {

    if (registerFailed && mbean instanceof DynamicMBean2)
        ((DynamicMBean2) mbean).registerFailed();
    try {
        if (mbean instanceof MBeanRegistration)
            ((MBeanRegistration) mbean).postRegister(registrationDone);
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Exception thrown by postRegister: " +
                "rethrowing <"+e+">, but keeping the MBean registered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postRegister method: "+
                  "rethrowing <"+e+">, but keeping the MBean registered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Error thrown by postRegister: " +
                "rethrowing <"+er+">, but keeping the MBean registered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postRegister method: "+
                  "rethrowing <"+er+">, but keeping the MBean registered");
    }
}
项目:jdk8u-jdk    文件:DefaultMBeanServerInterceptor.java   
private static void postDeregisterInvoke(ObjectName mbean,
        MBeanRegistration moi) {
    try {
        moi.postDeregister();
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Exception thrown by postDeregister: " +
                "rethrowing <"+e+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postDeregister method: "+
                  "rethrowing <"+e+
                  ">, although the MBean is sucessfully unregistered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Error thrown by postDeregister: " +
                "rethrowing <"+er+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postDeregister method: "+
                  "rethrowing <"+er+
                  ">, although the MBean is sucessfully unregistered");
    }
}
项目:openjdk-jdk10    文件:DefaultMBeanServerInterceptor.java   
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;
}
项目:openjdk-jdk10    文件:DefaultMBeanServerInterceptor.java   
private static void postRegister(
        ObjectName logicalName, DynamicMBean mbean,
        boolean registrationDone, boolean registerFailed) {

    if (registerFailed && mbean instanceof DynamicMBean2)
        ((DynamicMBean2) mbean).registerFailed();
    try {
        if (mbean instanceof MBeanRegistration)
            ((MBeanRegistration) mbean).postRegister(registrationDone);
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.log(Level.DEBUG, "While registering MBean ["+logicalName+
                "]: " + "Exception thrown by postRegister: " +
                "rethrowing <"+e+">, but keeping the MBean registered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postRegister method: "+
                  "rethrowing <"+e+">, but keeping the MBean registered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.log(Level.DEBUG, "While registering MBean ["+logicalName+
                "]: " + "Error thrown by postRegister: " +
                "rethrowing <"+er+">, but keeping the MBean registered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postRegister method: "+
                  "rethrowing <"+er+">, but keeping the MBean registered");
    }
}
项目:openjdk-jdk10    文件:DefaultMBeanServerInterceptor.java   
private static void postDeregisterInvoke(ObjectName mbean,
        MBeanRegistration moi) {
    try {
        moi.postDeregister();
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.log(Level.DEBUG, "While unregistering MBean ["+mbean+
                "]: " + "Exception thrown by postDeregister: " +
                "rethrowing <"+e+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postDeregister method: "+
                  "rethrowing <"+e+
                  ">, although the MBean is sucessfully unregistered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.log(Level.DEBUG, "While unregistering MBean ["+mbean+
                "]: " + "Error thrown by postDeregister: " +
                "rethrowing <"+er+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postDeregister method: "+
                  "rethrowing <"+er+
                  ">, although the MBean is sucessfully unregistered");
    }
}
项目:openjdk9    文件:DefaultMBeanServerInterceptor.java   
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;
}
项目:openjdk9    文件:DefaultMBeanServerInterceptor.java   
private static void postRegister(
        ObjectName logicalName, DynamicMBean mbean,
        boolean registrationDone, boolean registerFailed) {

    if (registerFailed && mbean instanceof DynamicMBean2)
        ((DynamicMBean2) mbean).registerFailed();
    try {
        if (mbean instanceof MBeanRegistration)
            ((MBeanRegistration) mbean).postRegister(registrationDone);
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Exception thrown by postRegister: " +
                "rethrowing <"+e+">, but keeping the MBean registered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postRegister method: "+
                  "rethrowing <"+e+">, but keeping the MBean registered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Error thrown by postRegister: " +
                "rethrowing <"+er+">, but keeping the MBean registered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postRegister method: "+
                  "rethrowing <"+er+">, but keeping the MBean registered");
    }
}
项目:openjdk9    文件:DefaultMBeanServerInterceptor.java   
private static void postDeregisterInvoke(ObjectName mbean,
        MBeanRegistration moi) {
    try {
        moi.postDeregister();
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Exception thrown by postDeregister: " +
                "rethrowing <"+e+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postDeregister method: "+
                  "rethrowing <"+e+
                  ">, although the MBean is sucessfully unregistered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Error thrown by postDeregister: " +
                "rethrowing <"+er+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postDeregister method: "+
                  "rethrowing <"+er+
                  ">, although the MBean is sucessfully unregistered");
    }
}
项目:jdk8u_jdk    文件:DefaultMBeanServerInterceptor.java   
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;
}
项目:jdk8u_jdk    文件:DefaultMBeanServerInterceptor.java   
private static void postRegister(
        ObjectName logicalName, DynamicMBean mbean,
        boolean registrationDone, boolean registerFailed) {

    if (registerFailed && mbean instanceof DynamicMBean2)
        ((DynamicMBean2) mbean).registerFailed();
    try {
        if (mbean instanceof MBeanRegistration)
            ((MBeanRegistration) mbean).postRegister(registrationDone);
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Exception thrown by postRegister: " +
                "rethrowing <"+e+">, but keeping the MBean registered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postRegister method: "+
                  "rethrowing <"+e+">, but keeping the MBean registered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Error thrown by postRegister: " +
                "rethrowing <"+er+">, but keeping the MBean registered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postRegister method: "+
                  "rethrowing <"+er+">, but keeping the MBean registered");
    }
}
项目:jdk8u_jdk    文件:DefaultMBeanServerInterceptor.java   
private static void postDeregisterInvoke(ObjectName mbean,
        MBeanRegistration moi) {
    try {
        moi.postDeregister();
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Exception thrown by postDeregister: " +
                "rethrowing <"+e+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postDeregister method: "+
                  "rethrowing <"+e+
                  ">, although the MBean is sucessfully unregistered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Error thrown by postDeregister: " +
                "rethrowing <"+er+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postDeregister method: "+
                  "rethrowing <"+er+
                  ">, although the MBean is sucessfully unregistered");
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:DefaultMBeanServerInterceptor.java   
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;
}
项目:lookaside_java-1.8.0-openjdk    文件:DefaultMBeanServerInterceptor.java   
private static void postRegister(
        ObjectName logicalName, DynamicMBean mbean,
        boolean registrationDone, boolean registerFailed) {

    if (registerFailed && mbean instanceof DynamicMBean2)
        ((DynamicMBean2) mbean).registerFailed();
    try {
        if (mbean instanceof MBeanRegistration)
            ((MBeanRegistration) mbean).postRegister(registrationDone);
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Exception thrown by postRegister: " +
                "rethrowing <"+e+">, but keeping the MBean registered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postRegister method: "+
                  "rethrowing <"+e+">, but keeping the MBean registered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Error thrown by postRegister: " +
                "rethrowing <"+er+">, but keeping the MBean registered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postRegister method: "+
                  "rethrowing <"+er+">, but keeping the MBean registered");
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:DefaultMBeanServerInterceptor.java   
private static void postDeregisterInvoke(ObjectName mbean,
        MBeanRegistration moi) {
    try {
        moi.postDeregister();
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Exception thrown by postDeregister: " +
                "rethrowing <"+e+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postDeregister method: "+
                  "rethrowing <"+e+
                  ">, although the MBean is sucessfully unregistered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Error thrown by postDeregister: " +
                "rethrowing <"+er+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postDeregister method: "+
                  "rethrowing <"+er+
                  ">, although the MBean is sucessfully unregistered");
    }
}
项目:infobip-open-jdk-8    文件:DefaultMBeanServerInterceptor.java   
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;
}
项目:infobip-open-jdk-8    文件:DefaultMBeanServerInterceptor.java   
private static void postRegister(
        ObjectName logicalName, DynamicMBean mbean,
        boolean registrationDone, boolean registerFailed) {

    if (registerFailed && mbean instanceof DynamicMBean2)
        ((DynamicMBean2) mbean).registerFailed();
    try {
        if (mbean instanceof MBeanRegistration)
            ((MBeanRegistration) mbean).postRegister(registrationDone);
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Exception thrown by postRegister: " +
                "rethrowing <"+e+">, but keeping the MBean registered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postRegister method: "+
                  "rethrowing <"+e+">, but keeping the MBean registered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Error thrown by postRegister: " +
                "rethrowing <"+er+">, but keeping the MBean registered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postRegister method: "+
                  "rethrowing <"+er+">, but keeping the MBean registered");
    }
}
项目:infobip-open-jdk-8    文件:DefaultMBeanServerInterceptor.java   
private static void postDeregisterInvoke(ObjectName mbean,
        MBeanRegistration moi) {
    try {
        moi.postDeregister();
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Exception thrown by postDeregister: " +
                "rethrowing <"+e+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postDeregister method: "+
                  "rethrowing <"+e+
                  ">, although the MBean is sucessfully unregistered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Error thrown by postDeregister: " +
                "rethrowing <"+er+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postDeregister method: "+
                  "rethrowing <"+er+
                  ">, although the MBean is sucessfully unregistered");
    }
}
项目:jdk8u-dev-jdk    文件:DefaultMBeanServerInterceptor.java   
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;
}
项目:jdk8u-dev-jdk    文件:DefaultMBeanServerInterceptor.java   
private static void postRegister(
        ObjectName logicalName, DynamicMBean mbean,
        boolean registrationDone, boolean registerFailed) {

    if (registerFailed && mbean instanceof DynamicMBean2)
        ((DynamicMBean2) mbean).registerFailed();
    try {
        if (mbean instanceof MBeanRegistration)
            ((MBeanRegistration) mbean).postRegister(registrationDone);
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Exception thrown by postRegister: " +
                "rethrowing <"+e+">, but keeping the MBean registered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postRegister method: "+
                  "rethrowing <"+e+">, but keeping the MBean registered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Error thrown by postRegister: " +
                "rethrowing <"+er+">, but keeping the MBean registered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postRegister method: "+
                  "rethrowing <"+er+">, but keeping the MBean registered");
    }
}
项目:jdk8u-dev-jdk    文件:DefaultMBeanServerInterceptor.java   
private static void postDeregisterInvoke(ObjectName mbean,
        MBeanRegistration moi) {
    try {
        moi.postDeregister();
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Exception thrown by postDeregister: " +
                "rethrowing <"+e+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postDeregister method: "+
                  "rethrowing <"+e+
                  ">, although the MBean is sucessfully unregistered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Error thrown by postDeregister: " +
                "rethrowing <"+er+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postDeregister method: "+
                  "rethrowing <"+er+
                  ">, although the MBean is sucessfully unregistered");
    }
}
项目:jdk7-jdk    文件:DefaultMBeanServerInterceptor.java   
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;
}
项目:jdk7-jdk    文件:DefaultMBeanServerInterceptor.java   
private static void postRegister(
        ObjectName logicalName, DynamicMBean mbean,
        boolean registrationDone, boolean registerFailed) {

    if (registerFailed && mbean instanceof DynamicMBean2)
        ((DynamicMBean2) mbean).registerFailed();
    try {
        if (mbean instanceof MBeanRegistration)
            ((MBeanRegistration) mbean).postRegister(registrationDone);
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Exception thrown by postRegister: " +
                "rethrowing <"+e+">, but keeping the MBean registered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postRegister method: "+
                  "rethrowing <"+e+">, but keeping the MBean registered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Error thrown by postRegister: " +
                "rethrowing <"+er+">, but keeping the MBean registered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postRegister method: "+
                  "rethrowing <"+er+">, but keeping the MBean registered");
    }
}
项目:jdk7-jdk    文件:DefaultMBeanServerInterceptor.java   
private static void postDeregisterInvoke(ObjectName mbean,
        MBeanRegistration moi) {
    try {
        moi.postDeregister();
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Exception thrown by postDeregister: " +
                "rethrowing <"+e+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postDeregister method: "+
                  "rethrowing <"+e+
                  ">, although the MBean is sucessfully unregistered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Error thrown by postDeregister: " +
                "rethrowing <"+er+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postDeregister method: "+
                  "rethrowing <"+er+
                  ">, although the MBean is sucessfully unregistered");
    }
}
项目:openjdk-source-code-learn    文件:DefaultMBeanServerInterceptor.java   
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;
}
项目:openjdk-source-code-learn    文件:DefaultMBeanServerInterceptor.java   
private static void postRegister(
        ObjectName logicalName, DynamicMBean mbean,
        boolean registrationDone, boolean registerFailed) {

    if (registerFailed && mbean instanceof DynamicMBean2)
        ((DynamicMBean2) mbean).registerFailed();
    try {
        if (mbean instanceof MBeanRegistration)
            ((MBeanRegistration) mbean).postRegister(registrationDone);
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Exception thrown by postRegister: " +
                "rethrowing <"+e+">, but keeping the MBean registered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postRegister method: "+
                  "rethrowing <"+e+">, but keeping the MBean registered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Error thrown by postRegister: " +
                "rethrowing <"+er+">, but keeping the MBean registered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postRegister method: "+
                  "rethrowing <"+er+">, but keeping the MBean registered");
    }
}
项目:openjdk-source-code-learn    文件:DefaultMBeanServerInterceptor.java   
private static void postDeregisterInvoke(ObjectName mbean,
        MBeanRegistration moi) {
    try {
        moi.postDeregister();
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Exception thrown by postDeregister: " +
                "rethrowing <"+e+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postDeregister method: "+
                  "rethrowing <"+e+
                  ">, although the MBean is sucessfully unregistered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Error thrown by postDeregister: " +
                "rethrowing <"+er+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postDeregister method: "+
                  "rethrowing <"+er+
                  ">, although the MBean is sucessfully unregistered");
    }
}
项目:OLD-OpenJDK8    文件:DefaultMBeanServerInterceptor.java   
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;
}
项目:OLD-OpenJDK8    文件:DefaultMBeanServerInterceptor.java   
private static void postRegister(
        ObjectName logicalName, DynamicMBean mbean,
        boolean registrationDone, boolean registerFailed) {

    if (registerFailed && mbean instanceof DynamicMBean2)
        ((DynamicMBean2) mbean).registerFailed();
    try {
        if (mbean instanceof MBeanRegistration)
            ((MBeanRegistration) mbean).postRegister(registrationDone);
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Exception thrown by postRegister: " +
                "rethrowing <"+e+">, but keeping the MBean registered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postRegister method: "+
                  "rethrowing <"+e+">, but keeping the MBean registered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Error thrown by postRegister: " +
                "rethrowing <"+er+">, but keeping the MBean registered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postRegister method: "+
                  "rethrowing <"+er+">, but keeping the MBean registered");
    }
}
项目:OLD-OpenJDK8    文件:DefaultMBeanServerInterceptor.java   
private static void postDeregisterInvoke(ObjectName mbean,
        MBeanRegistration moi) {
    try {
        moi.postDeregister();
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Exception thrown by postDeregister: " +
                "rethrowing <"+e+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postDeregister method: "+
                  "rethrowing <"+e+
                  ">, although the MBean is sucessfully unregistered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Error thrown by postDeregister: " +
                "rethrowing <"+er+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postDeregister method: "+
                  "rethrowing <"+er+
                  ">, although the MBean is sucessfully unregistered");
    }
}
项目:openjdk-jdk7u-jdk    文件:DefaultMBeanServerInterceptor.java   
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;
}
项目:openjdk-jdk7u-jdk    文件:DefaultMBeanServerInterceptor.java   
private static void postRegister(
        ObjectName logicalName, DynamicMBean mbean,
        boolean registrationDone, boolean registerFailed) {

    if (registerFailed && mbean instanceof DynamicMBean2)
        ((DynamicMBean2) mbean).registerFailed();
    try {
        if (mbean instanceof MBeanRegistration)
            ((MBeanRegistration) mbean).postRegister(registrationDone);
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Exception thrown by postRegister: " +
                "rethrowing <"+e+">, but keeping the MBean registered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postRegister method: "+
                  "rethrowing <"+e+">, but keeping the MBean registered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Error thrown by postRegister: " +
                "rethrowing <"+er+">, but keeping the MBean registered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postRegister method: "+
                  "rethrowing <"+er+">, but keeping the MBean registered");
    }
}
项目:openjdk-jdk7u-jdk    文件:DefaultMBeanServerInterceptor.java   
private static void postDeregisterInvoke(ObjectName mbean,
        MBeanRegistration moi) {
    try {
        moi.postDeregister();
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Exception thrown by postDeregister: " +
                "rethrowing <"+e+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postDeregister method: "+
                  "rethrowing <"+e+
                  ">, although the MBean is sucessfully unregistered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While unregistering MBean ["+mbean+
                "]: " + "Error thrown by postDeregister: " +
                "rethrowing <"+er+">, although the MBean is succesfully " +
                "unregistered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postDeregister method: "+
                  "rethrowing <"+er+
                  ">, although the MBean is sucessfully unregistered");
    }
}
项目:spring-osgi    文件:Activator.java   
private ServiceRegistration publishServerAsAService(StandardService server) {
    Properties props = new Properties();
    // put some extra properties to easily identify the service
    props.put(Constants.SERVICE_VENDOR, "Spring Dynamic Modules");
    props.put(Constants.SERVICE_DESCRIPTION, ServerInfo.getServerInfo());
    props.put(Constants.BUNDLE_VERSION, ServerInfo.getServerNumber());
    props.put(Constants.BUNDLE_NAME, bundleContext.getBundle().getSymbolicName());

    // spring-dm specific property
    props.put("org.springframework.osgi.bean.name", "tomcat-server");

    // publish just the interfaces and the major classes (server/handlerWrapper)
    String[] classes = new String[] { StandardService.class.getName(), Service.class.getName(),
        MBeanRegistration.class.getName(), Lifecycle.class.getName() };

    return bundleContext.registerService(classes, server, props);
}
项目:openjdk-icedtea7    文件:DefaultMBeanServerInterceptor.java   
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;
}
项目:openjdk-icedtea7    文件:DefaultMBeanServerInterceptor.java   
private static void postRegister(
        ObjectName logicalName, DynamicMBean mbean,
        boolean registrationDone, boolean registerFailed) {

    if (registerFailed && mbean instanceof DynamicMBean2)
        ((DynamicMBean2) mbean).registerFailed();
    try {
        if (mbean instanceof MBeanRegistration)
            ((MBeanRegistration) mbean).postRegister(registrationDone);
    } catch (RuntimeException e) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Exception thrown by postRegister: " +
                "rethrowing <"+e+">, but keeping the MBean registered");
        throw new RuntimeMBeanException(e,
                  "RuntimeException thrown in postRegister method: "+
                  "rethrowing <"+e+">, but keeping the MBean registered");
    } catch (Error er) {
        MBEANSERVER_LOGGER.fine("While registering MBean ["+logicalName+
                "]: " + "Error thrown by postRegister: " +
                "rethrowing <"+er+">, but keeping the MBean registered");
        throw new RuntimeErrorException(er,
                  "Error thrown in postRegister method: "+
                  "rethrowing <"+er+">, but keeping the MBean registered");
    }
}