@Override
    public ServiceBundle addServiceObjectWithQueueCallBackHandlers(final String serviceAddress,
                                                                   final Object serviceObject,
                                                                   final QueueCallBackHandler... queueCallBackHandlers) {
    """
	Add a client to this bundle, under a certain address.
	
	@param serviceAddress        the address of the client
	@param serviceObject         the client we want to add.
	@param queueCallBackHandlers queue callback handler
    """

        logger.info("Adding service {} @ {} with object {}", ServiceBundleImpl.class.getName(),
                serviceAddress, serviceObject);

        if (serviceObject instanceof Consumer) {

            //noinspection unchecked
            addServiceConsumer(serviceAddress, (Consumer<MethodCall<Object>>) serviceObject);
            return this;
        }


        if (serviceObject instanceof ServiceQueue) {
            addServiceService(serviceAddress, (ServiceQueue) serviceObject);
            return this;
        }

        /** Turn this client object into a client with queues. */
        final ServiceBuilder serviceBuilder = ServiceBuilder.serviceBuilder()
                .setRootAddress(rootAddress)
                .setServiceObject(serviceObject)
                .setServiceAddress(serviceAddress)
                .setTimer(timer)
                .setResponseQueue(responseQueue)
                .setAsyncResponse(asyncCalls)
                .setInvokeDynamic(invokeDynamic)
                .setSystemManager(systemManager)
                .setRequestQueueBuilder(BeanUtils.copy(this.requestQueueBuilder))
                .setRequestQueueBuilder(requestQueueBuilder)
                .setHandleCallbacks(false)
                .setCreateCallbackHandler(false)
                .setEventManager(eventManager)
                .setBeforeMethodCall(this.beforeMethodCallOnServiceQueue)
                .setAfterMethodCall(this.afterMethodCallOnServiceQueue);

        if (queueCallBackHandlers != null) {
            stream(queueCallBackHandlers).forEach(serviceBuilder::addQueueCallbackHandler);
        }


        final String bindStatHealthName = serviceAddress == null
                ? AnnotationUtils.readServiceName(serviceObject)
                : serviceAddress;

        if (healthService != null) {
            serviceBuilder.registerHealthChecks(healthService, bindStatHealthName);
        }


        if (statsCollector != null) {
            /*
              The default is to flush stats every five seconds, and sample
              every 10_000 queue calls.
             */
            serviceBuilder.registerStatsCollections(bindStatHealthName,
                    statsCollector, sampleStatFlushRate, checkTimingEveryXCalls);
        }


        final ServiceQueue serviceQueue = serviceBuilder.buildAndStart();

        addServiceService(serviceAddress, serviceQueue);
        return this;
    }
@Override
    public ServiceBundle addServiceObjectWithQueueCallBackHandlers(final String serviceAddress,
                                                                   final Object serviceObject,
                                                                   final QueueCallBackHandler... queueCallBackHandlers) {

        logger.info("Adding service {} @ {} with object {}", ServiceBundleImpl.class.getName(),
                serviceAddress, serviceObject);

        if (serviceObject instanceof Consumer) {

            //noinspection unchecked
            addServiceConsumer(serviceAddress, (Consumer<MethodCall<Object>>) serviceObject);
            return this;
        }


        if (serviceObject instanceof ServiceQueue) {
            addServiceService(serviceAddress, (ServiceQueue) serviceObject);
            return this;
        }

        /** Turn this client object into a client with queues. */
        final ServiceBuilder serviceBuilder = ServiceBuilder.serviceBuilder()
                .setRootAddress(rootAddress)
                .setServiceObject(serviceObject)
                .setServiceAddress(serviceAddress)
                .setTimer(timer)
                .setResponseQueue(responseQueue)
                .setAsyncResponse(asyncCalls)
                .setInvokeDynamic(invokeDynamic)
                .setSystemManager(systemManager)
                .setRequestQueueBuilder(BeanUtils.copy(this.requestQueueBuilder))
                .setRequestQueueBuilder(requestQueueBuilder)
                .setHandleCallbacks(false)
                .setCreateCallbackHandler(false)
                .setEventManager(eventManager)
                .setBeforeMethodCall(this.beforeMethodCallOnServiceQueue)
                .setAfterMethodCall(this.afterMethodCallOnServiceQueue);

        if (queueCallBackHandlers != null) {
            stream(queueCallBackHandlers).forEach(serviceBuilder::addQueueCallbackHandler);
        }


        final String bindStatHealthName = serviceAddress == null
                ? AnnotationUtils.readServiceName(serviceObject)
                : serviceAddress;

        if (healthService != null) {
            serviceBuilder.registerHealthChecks(healthService, bindStatHealthName);
        }


        if (statsCollector != null) {
            /*
              The default is to flush stats every five seconds, and sample
              every 10_000 queue calls.
             */
            serviceBuilder.registerStatsCollections(bindStatHealthName,
                    statsCollector, sampleStatFlushRate, checkTimingEveryXCalls);
        }


        final ServiceQueue serviceQueue = serviceBuilder.buildAndStart();

        addServiceService(serviceAddress, serviceQueue);
        return this;
    }
@ Override public ServiceBundle addServiceObjectWithQueueCallBackHandlers ( final String serviceAddress , final Object serviceObject , final QueueCallBackHandler ... queueCallBackHandlers ) { logger . info ( "Adding service {} @ {} with object {}" , ServiceBundleImpl . class . getName ( ) , serviceAddress , serviceObject ) ; if ( serviceObject instanceof Consumer ) { //noinspection unchecked addServiceConsumer ( serviceAddress , ( Consumer < MethodCall < Object > > ) serviceObject ) ; return this ; } if ( serviceObject instanceof ServiceQueue ) { addServiceService ( serviceAddress , ( ServiceQueue ) serviceObject ) ; return this ; } /** Turn this client object into a client with queues. */ final ServiceBuilder serviceBuilder = ServiceBuilder . serviceBuilder ( ) . setRootAddress ( rootAddress ) . setServiceObject ( serviceObject ) . setServiceAddress ( serviceAddress ) . setTimer ( timer ) . setResponseQueue ( responseQueue ) . setAsyncResponse ( asyncCalls ) . setInvokeDynamic ( invokeDynamic ) . setSystemManager ( systemManager ) . setRequestQueueBuilder ( BeanUtils . copy ( this . requestQueueBuilder ) ) . setRequestQueueBuilder ( requestQueueBuilder ) . setHandleCallbacks ( false ) . setCreateCallbackHandler ( false ) . setEventManager ( eventManager ) . setBeforeMethodCall ( this . beforeMethodCallOnServiceQueue ) . setAfterMethodCall ( this . afterMethodCallOnServiceQueue ) ; if ( queueCallBackHandlers != null ) { stream ( queueCallBackHandlers ) . forEach ( serviceBuilder :: addQueueCallbackHandler ) ; } final String bindStatHealthName = serviceAddress == null ? AnnotationUtils . readServiceName ( serviceObject ) : serviceAddress ; if ( healthService != null ) { serviceBuilder . registerHealthChecks ( healthService , bindStatHealthName ) ; } if ( statsCollector != null ) { /*
              The default is to flush stats every five seconds, and sample
              every 10_000 queue calls.
             */ serviceBuilder . registerStatsCollections ( bindStatHealthName , statsCollector , sampleStatFlushRate , checkTimingEveryXCalls ) ; } final ServiceQueue serviceQueue = serviceBuilder . buildAndStart ( ) ; addServiceService ( serviceAddress , serviceQueue ) ; return this ; }
Add a client to this bundle, under a certain address.

@param serviceAddress        the address of the client
@param serviceObject         the client we want to add.
@param queueCallBackHandlers queue callback handler
Add a client to this bundle under a certain address .