Class AbstractServiceResponseEvent

    • Constructor Detail

      • AbstractServiceResponseEvent

        public AbstractServiceResponseEvent​(java.lang.String origin,
                                            java.lang.String service,
                                            java.lang.String operation,
                                            ServiceRequestEvent requestEvent)
        Construct a new AbstractServiceResponseEvent
        Parameters:
        origin - the origin of the event
        service - the service name e.g. 'WeatherService'
        operation - the operation name e.g. 'getWeather'
        requestEvent - the associated request event
    • Method Detail

      • withResponse

        public AbstractServiceResponseEvent withResponse​(java.lang.Object response)
        Add a response object to this event
        Parameters:
        response - the response object
        Returns:
        the 'this' for method chaining
      • withThrown

        public AbstractServiceResponseEvent withThrown​(java.lang.Throwable thrown)
        Add a thrown exception to this event
        Parameters:
        thrown - the thrown exception
        Returns:
        the 'this' for method chaining
      • getResponse

        public java.lang.Object getResponse()
        Get the response object
        Specified by:
        getResponse in interface ServiceResponseEvent
        Returns:
        the response object
      • getThrown

        public java.lang.Throwable getThrown()
        Get the thrown exception
        Specified by:
        getThrown in interface ServiceResponseEvent
        Returns:
        the thrown exception