Package org.weakref.jmx

Examples of org.weakref.jmx.ObjectNameBuilder


    @Provides
    @ServiceType("discovery")
    synchronized public HttpServiceBalancerImpl getHttpServiceBalancerImpl(ReportCollectionFactory reportCollectionFactory)
    {
        if (discoveryBalancer == null) {
            String name = new ObjectNameBuilder(HttpServiceBalancerStats.class.getPackage().getName())
                    .withProperty("type", "ServiceClient")
                    .withProperty("serviceType", "discovery")
                    .build();
            discoveryBalancer = new HttpServiceBalancerImpl("discovery", reportCollectionFactory.createReportCollection(HttpServiceBalancerStats.class, name));
        }
View Full Code Here


        if (!isJaxRsResource(resourceClass)) {
            return;
        }

        String objectName = new ObjectNameBuilder(resourceClass.getPackage().getName())
                .withProperty("type", resourceClass.getSimpleName())
                .build();
        RequestStats requestStats = requestStatsLoadingCache.getUnchecked(objectName);

        featureContext.register(new TimingFilter(resourceMethod.getName(), requestStats));
View Full Code Here

    {
        checkNotNull(type, "type is null");
        checkNotNull(selectorConfig, "selectorConfig is null");

        String pool = firstNonNull(selectorConfig.getPool(), nodeInfo.getPool());
        String name = new ObjectNameBuilder(HttpServiceBalancerStats.class.getPackage().getName())
                .withProperty("type", "ServiceClient")
                .withProperty("serviceType", type)
                .build();
        HttpServiceBalancerStats httpServiceBalancerStats = reportCollectionFactory.createReportCollection(HttpServiceBalancerStats.class, name);
        HttpServiceBalancerImpl balancer = new HttpServiceBalancerImpl(format("type=[%s], pool=[%s]", type, pool), httpServiceBalancerStats);
View Full Code Here

                        public Object load(List<Optional<String>> key)
                                throws Exception
                        {
                            Object returnValue = returnValueSupplier.get();

                            ObjectNameBuilder objectNameBuilder = new ObjectNameBuilder(packageName);
                            for (Entry<String, String> entry : properties.entrySet()) {
                                objectNameBuilder = objectNameBuilder.withProperty(entry.getKey(), entry.getValue());
                            }
                            objectNameBuilder = objectNameBuilder.withProperty("name", upperMethodName);
                            for (int i = 0; i < keyNames.size(); ++i) {
                                if (key.get(i).isPresent()) {
                                    objectNameBuilder = objectNameBuilder.withProperty(keyNames.get(i), key.get(i).get());
                                }
                            }
                            String objectName = objectNameBuilder.build();

                            synchronized (registeredMap) {
                                Object existingStat = registeredMap.get(key);
                                if (existingStat != null) {
                                    reinsertedSet.add(existingStat);
View Full Code Here

    @Test
    public void testNamedCollection()
            throws Exception
    {
        String name = new ObjectNameBuilder(KeyedDistribution.class.getPackage().getName())
                .withProperty("a", "fooval")
                .withProperty("b", "with\"quote")
                .withProperty("c", "with,comma")
                .withProperty("d", "with\\backslash")
                .build();
View Full Code Here

        Multibinder.newSetBinder(binder, Filter.class, TheAdminServlet.class);
        Multibinder.newSetBinder(binder, HttpResourceBinding.class, TheServlet.class);

        reportBinder(binder).export(HttpServer.class).withGeneratedName();
        reportBinder(binder).bindReportCollection(DetailedRequestStats.class).as(
                new ObjectNameBuilder(RequestStats.class.getPackage().getName())
                        .withProperty("type", "HttpServer")
                        .build()
        );

        ConfigurationModule.bindConfig(binder).to(HttpServerConfig.class);
View Full Code Here

TOP

Related Classes of org.weakref.jmx.ObjectNameBuilder

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.