Top Description Methods
org.glassfish.hk2.api

public Interface ErrorService

Known Direct Implementers
org.glassfish.hk2.internal.ImmediateHelper, org.glassfish.hk2.utilities.IgnoringErrorService, org.glassfish.hk2.utilities.RethrowErrorService
Annotations
@Contract
Imports
org.jvnet.hk2.annotations.Contract

This interface should be implemented by those who wish to be notified of error conditions that occur within HK2. These errors are those that might happen during normal processing of HK2 requests

An implementation of ErrorService must be in the Singleton scope. Implementations of ErrorService will be instantiated as soon as they are added to HK2 in order to avoid deadlocks and circular references. Therefore it is recommended that implementations of ErrorService make liberal use of jakarta.inject.Provider or IterableProvider when injecting dependent services so that these services are not instantiated when the ErrorService is created

Author
jwells

Method Summary

Modifier and TypeMethod and Description
public void
onFailure(ErrorInformation
Information about the error that occurred
errorInformation
)

This method is called when a failure occurs in the system.

Method Detail

onFailureback to summary
public void onFailure(ErrorInformation errorInformation) throws MultiException

This method is called when a failure occurs in the system. This method may use any ServiceLocator api. For example, an implementation of this method might want to remove a descriptor from the registry if the error can be determined to be a permanent failure.

Parameters
errorInformation:ErrorInformation

Information about the error that occurred

Exceptions
MultiException:
if this method throws an exception that exception will be thrown back to the caller wrapped in another MultiException if the error is of type ErrorType#FAILURE_TO_REIFY. If the error is of type ErrorType#DYNAMIC_CONFIGURATION_FAILURE or ErrorType#SERVICE_CREATION_FAILURE or ErrorType#SERVICE_DESTRUCTION_FAILURE then any exception thrown from this method is ignored and the original exception is thrown back to the caller