com.sun.org.glassfish.gmbal.ManagedObjectManager Java Examples

The following examples show how to use com.sun.org.glassfish.gmbal.ManagedObjectManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MonitorBase.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private @NotNull ManagedObjectManager createMOM(final boolean isFederated) {
    try {
        return new RewritingMOM(isFederated ?
            ManagedObjectManagerFactory.createFederated(
                AMXGlassfish.DEFAULT.serverMon(AMXGlassfish.DEFAULT.dasName()))
            :
            ManagedObjectManagerFactory.createStandalone("com.sun.metro"));
    } catch (Throwable t) {
        if (isFederated) {
            logger.log(Level.CONFIG, "Problem while attempting to federate with GlassFish AMX monitoring.  Trying standalone.", t);
            return createMOM(false);
        } else {
            logger.log(Level.WARNING, "Ignoring exception - starting up without monitoring", t);
            return ManagedObjectManagerFactory.createNOOP();
        }
    }
}
 
Example #2
Source File: MonitorBase.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private @NotNull ManagedObjectManager createMOM(final boolean isFederated) {
    try {
        return new RewritingMOM(isFederated ?
            ManagedObjectManagerFactory.createFederated(
                AMXGlassfish.DEFAULT.serverMon(AMXGlassfish.DEFAULT.dasName()))
            :
            ManagedObjectManagerFactory.createStandalone("com.sun.metro"));
    } catch (Throwable t) {
        if (isFederated) {
            logger.log(Level.CONFIG, "Problem while attempting to federate with GlassFish AMX monitoring.  Trying standalone.", t);
            return createMOM(false);
        } else {
            logger.log(Level.WARNING, "Ignoring exception - starting up without monitoring", t);
            return ManagedObjectManagerFactory.createNOOP();
        }
    }
}
 
Example #3
Source File: MonitorBase.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private @NotNull ManagedObjectManager createMOM(final boolean isFederated) {
    try {
        return new RewritingMOM(isFederated ?
            ManagedObjectManagerFactory.createFederated(
                AMXGlassfish.DEFAULT.serverMon(AMXGlassfish.DEFAULT.dasName()))
            :
            ManagedObjectManagerFactory.createStandalone("com.sun.metro"));
    } catch (Throwable t) {
        if (isFederated) {
            logger.log(Level.CONFIG, "Problem while attempting to federate with GlassFish AMX monitoring.  Trying standalone.", t);
            return createMOM(false);
        } else {
            logger.log(Level.WARNING, "Ignoring exception - starting up without monitoring", t);
            return ManagedObjectManagerFactory.createNOOP();
        }
    }
}
 
Example #4
Source File: MonitorBase.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private @NotNull ManagedObjectManager createMOM(final boolean isFederated) {
    try {
        return new RewritingMOM(isFederated ?
            ManagedObjectManagerFactory.createFederated(
                AMXGlassfish.DEFAULT.serverMon(AMXGlassfish.DEFAULT.dasName()))
            :
            ManagedObjectManagerFactory.createStandalone("com.sun.metro"));
    } catch (Throwable t) {
        if (isFederated) {
            logger.log(Level.CONFIG, "Problem while attempting to federate with GlassFish AMX monitoring.  Trying standalone.", t);
            return createMOM(false);
        } else {
            logger.log(Level.WARNING, "Ignoring exception - starting up without monitoring", t);
            return ManagedObjectManagerFactory.createNOOP();
        }
    }
}
 
Example #5
Source File: MonitorBase.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private @NotNull ManagedObjectManager createMOM(final boolean isFederated) {
    try {
        return new RewritingMOM(isFederated ?
            ManagedObjectManagerFactory.createFederated(
                AMXGlassfish.DEFAULT.serverMon(AMXGlassfish.DEFAULT.dasName()))
            :
            ManagedObjectManagerFactory.createStandalone("com.sun.metro"));
    } catch (Throwable t) {
        if (isFederated) {
            logger.log(Level.CONFIG, "Problem while attempting to federate with GlassFish AMX monitoring.  Trying standalone.", t);
            return createMOM(false);
        } else {
            logger.log(Level.WARNING, "Ignoring exception - starting up without monitoring", t);
            return ManagedObjectManagerFactory.createNOOP();
        }
    }
}
 
Example #6
Source File: MonitorBase.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private @NotNull ManagedObjectManager createMOMLoop(final String rootName, final int unique) {
    final boolean isFederated = AMXGlassfish.getGlassfishVersion() != null;
    ManagedObjectManager mom = createMOM(isFederated);
    mom = initMOM(mom);
    mom = createRoot(mom, rootName, unique);
    return mom;
}
 
Example #7
Source File: MonitorBase.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Client monitoring is OFF by default because there is
 * no standard stub.close() method.  Therefore people do
 * not typically close a stub when they are done with it
 * (even though the RI does provide a .close).
 * <pre>
 * prop    |  no assert | assert/no mon | assert/mon off | assert/mon on
 * -------------------------------------------------------------------
 * not set |    off     |      off      |     off        |     on
 * false   |    off     |      off      |     off        |     off
 * true    |    on      |      on       |     off        |     on
 * </pre>
*/
@NotNull public ManagedObjectManager createManagedObjectManager(final Stub stub) {
    EndpointAddress ea = stub.requestContext.getEndpointAddress();
    if (ea == null) {
        return ManagedObjectManagerFactory.createNOOP();
    }

    String rootName = ea.toString();

    final ManagedClientAssertion assertion =
        ManagedClientAssertion.getAssertion(stub.getPortInfo());
    if (assertion != null) {
        final String id = assertion.getId();
        if (id != null) {
            rootName = id;
        }
        if (assertion.monitoringAttribute() == Setting.OFF) {
            return disabled("This client", rootName);
        } else if (assertion.monitoringAttribute() == Setting.ON &&
                   clientMonitoring != Setting.OFF) {
            return createMOMLoop(rootName, 0);
        }
    }

    if (clientMonitoring == Setting.NOT_SET ||
        clientMonitoring == Setting.OFF)
    {
        return disabled("Global client", rootName);
    }
    return createMOMLoop(rootName, 0);
}
 
Example #8
Source File: MonitorBase.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Client monitoring is OFF by default because there is
 * no standard stub.close() method.  Therefore people do
 * not typically close a stub when they are done with it
 * (even though the RI does provide a .close).
 * <pre>
 * prop    |  no assert | assert/no mon | assert/mon off | assert/mon on
 * -------------------------------------------------------------------
 * not set |    off     |      off      |     off        |     on
 * false   |    off     |      off      |     off        |     off
 * true    |    on      |      on       |     off        |     on
 * </pre>
*/
@NotNull public ManagedObjectManager createManagedObjectManager(final Stub stub) {
    EndpointAddress ea = stub.requestContext.getEndpointAddress();
    if (ea == null) {
        return ManagedObjectManagerFactory.createNOOP();
    }

    String rootName = ea.toString();

    final ManagedClientAssertion assertion =
        ManagedClientAssertion.getAssertion(stub.getPortInfo());
    if (assertion != null) {
        final String id = assertion.getId();
        if (id != null) {
            rootName = id;
        }
        if (assertion.monitoringAttribute() == Setting.OFF) {
            return disabled("This client", rootName);
        } else if (assertion.monitoringAttribute() == Setting.ON &&
                   clientMonitoring != Setting.OFF) {
            return createMOMLoop(rootName, 0);
        }
    }

    if (clientMonitoring == Setting.NOT_SET ||
        clientMonitoring == Setting.OFF)
    {
        return disabled("Global client", rootName);
    }
    return createMOMLoop(rootName, 0);
}
 
Example #9
Source File: WSEndpointMOMProxy.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a real instance of {@link ManagedObjectManager}
 *
 * @return an ManagedObjectManager instance
 */
@Override
public ManagedObjectManager getManagedObjectManager() {
    if (managedObjectManager == null) {
        managedObjectManager = wsEndpoint.obtainManagedObjectManager();
    }
    return managedObjectManager;
}
 
Example #10
Source File: MonitorBase.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private @NotNull ManagedObjectManager createMOMLoop(final String rootName, final int unique) {
    final boolean isFederated = AMXGlassfish.getGlassfishVersion() != null;
    ManagedObjectManager mom = createMOM(isFederated);
    mom = initMOM(mom);
    mom = createRoot(mom, rootName, unique);
    return mom;
}
 
Example #11
Source File: WSEndpointImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains a real instance of {@code ManagedObjectManager} class no matter what lazyMOMProviderScope is this endpoint in (or if the
 * Gmbal API calls should be deferred).
 *
 * @see com.sun.xml.internal.ws.api.server.LazyMOMProvider.Scope
 * @return an instance of {@code ManagedObjectManager}
 */
@NotNull ManagedObjectManager obtainManagedObjectManager() {
    final MonitorRootService monitorRootService = new MonitorRootService(this);
    final ManagedObjectManager mOM = monitorRootService.createManagedObjectManager(this);

    // ManagedObjectManager was suspended due to root creation (see MonitorBase#initMOM)
    mOM.resumeJMXRegistration();

    return mOM;
}
 
Example #12
Source File: WSEndpointMOMProxy.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a real instance of {@link ManagedObjectManager}
 *
 * @return an ManagedObjectManager instance
 */
@Override
public ManagedObjectManager getManagedObjectManager() {
    if (managedObjectManager == null) {
        managedObjectManager = wsEndpoint.obtainManagedObjectManager();
    }
    return managedObjectManager;
}
 
Example #13
Source File: MonitorBase.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Client monitoring is OFF by default because there is
 * no standard stub.close() method.  Therefore people do
 * not typically close a stub when they are done with it
 * (even though the RI does provide a .close).
 * <pre>
 * prop    |  no assert | assert/no mon | assert/mon off | assert/mon on
 * -------------------------------------------------------------------
 * not set |    off     |      off      |     off        |     on
 * false   |    off     |      off      |     off        |     off
 * true    |    on      |      on       |     off        |     on
 * </pre>
*/
@NotNull public ManagedObjectManager createManagedObjectManager(final Stub stub) {
    EndpointAddress ea = stub.requestContext.getEndpointAddress();
    if (ea == null) {
        return ManagedObjectManagerFactory.createNOOP();
    }

    String rootName = ea.toString();

    final ManagedClientAssertion assertion =
        ManagedClientAssertion.getAssertion(stub.getPortInfo());
    if (assertion != null) {
        final String id = assertion.getId();
        if (id != null) {
            rootName = id;
        }
        if (assertion.monitoringAttribute() == Setting.OFF) {
            return disabled("This client", rootName);
        } else if (assertion.monitoringAttribute() == Setting.ON &&
                   clientMonitoring != Setting.OFF) {
            return createMOMLoop(rootName, 0);
        }
    }

    if (clientMonitoring == Setting.NOT_SET ||
        clientMonitoring == Setting.OFF)
    {
        return disabled("Global client", rootName);
    }
    return createMOMLoop(rootName, 0);
}
 
Example #14
Source File: MonitorBase.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Client monitoring is OFF by default because there is
 * no standard stub.close() method.  Therefore people do
 * not typically close a stub when they are done with it
 * (even though the RI does provide a .close).
 * <pre>
 * prop    |  no assert | assert/no mon | assert/mon off | assert/mon on
 * -------------------------------------------------------------------
 * not set |    off     |      off      |     off        |     on
 * false   |    off     |      off      |     off        |     off
 * true    |    on      |      on       |     off        |     on
 * </pre>
*/
@NotNull public ManagedObjectManager createManagedObjectManager(final Stub stub) {
    EndpointAddress ea = stub.requestContext.getEndpointAddress();
    if (ea == null) {
        return ManagedObjectManagerFactory.createNOOP();
    }

    String rootName = ea.toString();

    final ManagedClientAssertion assertion =
        ManagedClientAssertion.getAssertion(stub.getPortInfo());
    if (assertion != null) {
        final String id = assertion.getId();
        if (id != null) {
            rootName = id;
        }
        if (assertion.monitoringAttribute() == Setting.OFF) {
            return disabled("This client", rootName);
        } else if (assertion.monitoringAttribute() == Setting.ON &&
                   clientMonitoring != Setting.OFF) {
            return createMOMLoop(rootName, 0);
        }
    }

    if (clientMonitoring == Setting.NOT_SET ||
        clientMonitoring == Setting.OFF)
    {
        return disabled("Global client", rootName);
    }
    return createMOMLoop(rootName, 0);
}
 
Example #15
Source File: MonitorBase.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private @NotNull ManagedObjectManager createMOMLoop(final String rootName, final int unique) {
    final boolean isFederated = AMXGlassfish.getGlassfishVersion() != null;
    ManagedObjectManager mom = createMOM(isFederated);
    mom = initMOM(mom);
    mom = createRoot(mom, rootName, unique);
    return mom;
}
 
Example #16
Source File: MonitorBase.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private @NotNull ManagedObjectManager createMOMLoop(final String rootName, final int unique) {
    final boolean isFederated = AMXGlassfish.getGlassfishVersion() != null;
    ManagedObjectManager mom = createMOM(isFederated);
    mom = initMOM(mom);
    mom = createRoot(mom, rootName, unique);
    return mom;
}
 
Example #17
Source File: WSEndpointMOMProxy.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a real instance of {@link ManagedObjectManager}
 *
 * @return an ManagedObjectManager instance
 */
@Override
public ManagedObjectManager getManagedObjectManager() {
    if (managedObjectManager == null) {
        managedObjectManager = wsEndpoint.obtainManagedObjectManager();
    }
    return managedObjectManager;
}
 
Example #18
Source File: WSEndpointImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains a real instance of {@code ManagedObjectManager} class no matter what lazyMOMProviderScope is this endpoint in (or if the
 * Gmbal API calls should be deferred).
 *
 * @see com.sun.xml.internal.ws.api.server.LazyMOMProvider.Scope
 * @return an instance of {@code ManagedObjectManager}
 */
@NotNull ManagedObjectManager obtainManagedObjectManager() {
    final MonitorRootService monitorRootService = new MonitorRootService(this);
    final ManagedObjectManager mOM = monitorRootService.createManagedObjectManager(this);

    // ManagedObjectManager was suspended due to root creation (see MonitorBase#initMOM)
    mOM.resumeJMXRegistration();

    return mOM;
}
 
Example #19
Source File: WSEndpointImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains a real instance of {@code ManagedObjectManager} class no matter what lazyMOMProviderScope is this endpoint in (or if the
 * Gmbal API calls should be deferred).
 *
 * @see com.sun.xml.internal.ws.api.server.LazyMOMProvider.Scope
 * @return an instance of {@code ManagedObjectManager}
 */
@NotNull ManagedObjectManager obtainManagedObjectManager() {
    final MonitorRootService monitorRootService = new MonitorRootService(this);
    final ManagedObjectManager mOM = monitorRootService.createManagedObjectManager(this);

    // ManagedObjectManager was suspended due to root creation (see MonitorBase#initMOM)
    mOM.resumeJMXRegistration();

    return mOM;
}
 
Example #20
Source File: MonitorBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Client monitoring is OFF by default because there is
 * no standard stub.close() method.  Therefore people do
 * not typically close a stub when they are done with it
 * (even though the RI does provide a .close).
 * <pre>
 * prop    |  no assert | assert/no mon | assert/mon off | assert/mon on
 * -------------------------------------------------------------------
 * not set |    off     |      off      |     off        |     on
 * false   |    off     |      off      |     off        |     off
 * true    |    on      |      on       |     off        |     on
 * </pre>
*/
@NotNull public ManagedObjectManager createManagedObjectManager(final Stub stub) {
    EndpointAddress ea = stub.requestContext.getEndpointAddress();
    if (ea == null) {
        return ManagedObjectManagerFactory.createNOOP();
    }

    String rootName = ea.toString();

    final ManagedClientAssertion assertion =
        ManagedClientAssertion.getAssertion(stub.getPortInfo());
    if (assertion != null) {
        final String id = assertion.getId();
        if (id != null) {
            rootName = id;
        }
        if (assertion.monitoringAttribute() == Setting.OFF) {
            return disabled("This client", rootName);
        } else if (assertion.monitoringAttribute() == Setting.ON &&
                   clientMonitoring != Setting.OFF) {
            return createMOMLoop(rootName, 0);
        }
    }

    if (clientMonitoring == Setting.NOT_SET ||
        clientMonitoring == Setting.OFF)
    {
        return disabled("Global client", rootName);
    }
    return createMOMLoop(rootName, 0);
}
 
Example #21
Source File: MonitorBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private @NotNull ManagedObjectManager createMOMLoop(final String rootName, final int unique) {
    final boolean isFederated = AMXGlassfish.getGlassfishVersion() != null;
    ManagedObjectManager mom = createMOM(isFederated);
    mom = initMOM(mom);
    mom = createRoot(mom, rootName, unique);
    return mom;
}
 
Example #22
Source File: WSEndpointImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains a real instance of {@code ManagedObjectManager} class no matter what lazyMOMProviderScope is this endpoint in (or if the
 * Gmbal API calls should be deferred).
 *
 * @see com.sun.xml.internal.ws.api.server.LazyMOMProvider.Scope
 * @return an instance of {@code ManagedObjectManager}
 */
@NotNull ManagedObjectManager obtainManagedObjectManager() {
    final MonitorRootService monitorRootService = new MonitorRootService(this);
    final ManagedObjectManager mOM = monitorRootService.createManagedObjectManager(this);

    // ManagedObjectManager was suspended due to root creation (see MonitorBase#initMOM)
    mOM.resumeJMXRegistration();

    return mOM;
}
 
Example #23
Source File: WSEndpointMOMProxy.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a real instance of {@link ManagedObjectManager}
 *
 * @return an ManagedObjectManager instance
 */
@Override
public ManagedObjectManager getManagedObjectManager() {
    if (managedObjectManager == null) {
        managedObjectManager = wsEndpoint.obtainManagedObjectManager();
    }
    return managedObjectManager;
}
 
Example #24
Source File: MonitorBase.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private @NotNull ManagedObjectManager createMOMLoop(final String rootName, final int unique) {
    final boolean isFederated = AMXGlassfish.getGlassfishVersion() != null;
    ManagedObjectManager mom = createMOM(isFederated);
    mom = initMOM(mom);
    mom = createRoot(mom, rootName, unique);
    return mom;
}
 
Example #25
Source File: WSEndpointMOMProxy.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a real instance of {@link ManagedObjectManager}
 *
 * @return an ManagedObjectManager instance
 */
@Override
public ManagedObjectManager getManagedObjectManager() {
    if (managedObjectManager == null) {
        managedObjectManager = wsEndpoint.obtainManagedObjectManager();
    }
    return managedObjectManager;
}
 
Example #26
Source File: WSEndpointImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Obtains a real instance of {@code ManagedObjectManager} class no matter what lazyMOMProviderScope is this endpoint in (or if the
 * Gmbal API calls should be deferred).
 *
 * @see com.sun.xml.internal.ws.api.server.LazyMOMProvider.Scope
 * @return an instance of {@code ManagedObjectManager}
 */
@NotNull ManagedObjectManager obtainManagedObjectManager() {
    final MonitorRootService monitorRootService = new MonitorRootService(this);
    final ManagedObjectManager mOM = monitorRootService.createManagedObjectManager(this);

    // ManagedObjectManager was suspended due to root creation (see MonitorBase#initMOM)
    mOM.resumeJMXRegistration();

    return mOM;
}
 
Example #27
Source File: MonitorBase.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Client monitoring is OFF by default because there is
 * no standard stub.close() method.  Therefore people do
 * not typically close a stub when they are done with it
 * (even though the RI does provide a .close).
 * <pre>
 * prop    |  no assert | assert/no mon | assert/mon off | assert/mon on
 * -------------------------------------------------------------------
 * not set |    off     |      off      |     off        |     on
 * false   |    off     |      off      |     off        |     off
 * true    |    on      |      on       |     off        |     on
 * </pre>
*/
@NotNull public ManagedObjectManager createManagedObjectManager(final Stub stub) {
    EndpointAddress ea = stub.requestContext.getEndpointAddress();
    if (ea == null) {
        return ManagedObjectManagerFactory.createNOOP();
    }

    String rootName = ea.toString();

    final ManagedClientAssertion assertion =
        ManagedClientAssertion.getAssertion(stub.getPortInfo());
    if (assertion != null) {
        final String id = assertion.getId();
        if (id != null) {
            rootName = id;
        }
        if (assertion.monitoringAttribute() == Setting.OFF) {
            return disabled("This client", rootName);
        } else if (assertion.monitoringAttribute() == Setting.ON &&
                   clientMonitoring != Setting.OFF) {
            return createMOMLoop(rootName, 0);
        }
    }

    if (clientMonitoring == Setting.NOT_SET ||
        clientMonitoring == Setting.OFF)
    {
        return disabled("Global client", rootName);
    }
    return createMOMLoop(rootName, 0);
}
 
Example #28
Source File: WSEndpointMOMProxy.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns a real instance of {@link ManagedObjectManager}
 *
 * @return an ManagedObjectManager instance
 */
@Override
public ManagedObjectManager getManagedObjectManager() {
    if (managedObjectManager == null) {
        managedObjectManager = wsEndpoint.obtainManagedObjectManager();
    }
    return managedObjectManager;
}
 
Example #29
Source File: Stub.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public
@NotNull
@Override
ManagedObjectManager getManagedObjectManager() {
    return managedObjectManager;
}
 
Example #30
Source File: WSEndpointMOMProxy.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
void setManagedObjectManager(ManagedObjectManager managedObjectManager) {
    this.managedObjectManager = managedObjectManager;
}