

Public Member Functions | |
| Object | invoke (Object proxy, Method method, Object[] args) throws Throwable |
Package Functions | |
| void | setMethodsExcludedFromInvocationLogging (String[] excludedMethods) |
Static Package Functions | |
| static Object | createContainerSealant (Class corbaInterface, Object component, String name, boolean isOffShoot, Logger logger, ClassLoader componentContextCL, String[] methodNamesExcludedFromInvocationLogging) throws AcsJContainerEx |
Private Member Functions | |
| ContainerSealant (Object componentImpl, String name, Logger logger, ClassLoader componentContextCL, boolean isOffShoot) | |
| boolean | isExcludedFromInvocationLogging (String methodName) |
| Throwable | unwindThrowableHierarchy (Throwable thr) |
Private Attributes | |
| final String | m_name |
| final Object | m_component |
| final Logger | m_logger |
| final ClassLoader | componentContextCL |
| final boolean | isOffShoot |
| final Set< String > | methodNamesExcludedFromInvocationLogging |
Seals the container to make it a "tight container", as opposed to an "open container". There's one sealant instance per component instance. The sealant is placed between the CORBA POATie on the one side, and the component implementation class or the component interface translator (if present) on the other side. The sealant therefore intercepts all functional calls made to the component.
This sealant class is not only used for components, but also for offshoots from that component, if they follow the tie-approach.
Todo: let listeners register, and notify them of any intercepted call; they may either veto down the invocation, or simply trace the call. Any logging, security checks etc. should be done by such listeners in the future.
| alma::acs::container::ContainerSealant::ContainerSealant | ( | Object | componentImpl, | |
| String | name, | |||
| Logger | logger, | |||
| ClassLoader | componentContextCL, | |||
| boolean | isOffShoot | |||
| ) | [inline, private] |
References m_component, m_logger, m_name, and methodNamesExcludedFromInvocationLogging.
Referenced by createContainerSealant().
| static Object alma::acs::container::ContainerSealant::createContainerSealant | ( | Class | corbaInterface, | |
| Object | component, | |||
| String | name, | |||
| boolean | isOffShoot, | |||
| Logger | logger, | |||
| ClassLoader | componentContextCL, | |||
| String[] | methodNamesExcludedFromInvocationLogging | |||
| ) | throws AcsJContainerEx [inline, static, package] |
Creates a ContainerSealant and uses it as the invocation handler for the returned dynamic proxy which implements corbaInterface.
| corbaInterface | the interface that the created sealant will implement; this should be the component's xxxOperations interface. | |
| component | the component implementation class, or any translator class in front of the component implementation. componentImpl must implement corbaInterface so that the sealant can forward calls to the component. | |
| name | the component instance name (used for logging) | |
| isOffShoot | true if the component object is actually an offshoot of a component | |
| logger | logger to be used by this class | |
| componentContextCL | classloader used for Thread#setContextClassLoader(java.lang.ClassLoader setContextClassLoader) before component method gets invoked. (after the call, the old context CL will be restored.) | |
| methodNamesExcludedFromInvocationLogging |
corbaInterface that intercepts calls to componentImpl and forwards them if restrictions allow this. | ContainerException | |
References componentContextCL, ContainerSealant(), isOffShoot, methodNamesExcludedFromInvocationLogging, alma::JavaContainerError::wrappers::AcsJContainerEx::setContextInfo(), and setMethodsExcludedFromInvocationLogging().
| Object alma::acs::container::ContainerSealant::invoke | ( | Object | proxy, | |
| Method | method, | |||
| Object[] | args | |||
| ) | throws Throwable [inline] |
Receives functional calls to the component.
Thread.currentThread().getContextClassLoader(). todo: add security and other container features here, especially check the component state!!!
References componentContextCL, alma::acs::util::StopWatch::getLapTimeMillis(), isExcludedFromInvocationLogging(), isOffShoot, m_component, m_logger, m_name, and unwindThrowableHierarchy().
| boolean alma::acs::container::ContainerSealant::isExcludedFromInvocationLogging | ( | String | methodName | ) | [inline, private] |
Checks if an invoked method is known to be excluded from logging. This is always true for componentState, and for all methods that are set for no-logging.
References methodNamesExcludedFromInvocationLogging.
Referenced by invoke().
| void alma::acs::container::ContainerSealant::setMethodsExcludedFromInvocationLogging | ( | String[] | excludedMethods | ) | [inline, package] |
Disables automatic invocation logging for certain component or offshoot methods.
The method componentState gets always excluded, independently of excludedMethods. It is a hard-coded special case.
For components, the method name must be given directly. For offshoots, method names must be qualified, see comment for ComponentHelper where component developers can specify these strings.
TODO: check if calls to JBaci properties should be also excluded hard-coded. At the moment the component helper class must specify them explicitly, e.g. "OFFSHOOT::alma.ACS.ROstringSeq#get_sync". This is not intuitive because JBaci properties are not visibly offshoots for the user, this is only an ACS implementation choice.
| excludedMethods | the names of methods to exclude from automatic logging. |
References isOffShoot, m_logger, m_name, and methodNamesExcludedFromInvocationLogging.
Referenced by createContainerSealant().
| Throwable alma::acs::container::ContainerSealant::unwindThrowableHierarchy | ( | Throwable | thr | ) | [inline, private] |
Pops InvocationTargetExceptions and UndeclaredThrowableExceptions off the exception cause stack, until a "real" exception is found.
| thr |
Referenced by invoke().
final ClassLoader alma::acs::container::ContainerSealant::componentContextCL [private] |
Referenced by createContainerSealant(), and invoke().
final boolean alma::acs::container::ContainerSealant::isOffShoot [private] |
Referenced by createContainerSealant(), invoke(), and setMethodsExcludedFromInvocationLogging().
final Object alma::acs::container::ContainerSealant::m_component [private] |
Referenced by ContainerSealant(), and invoke().
final Logger alma::acs::container::ContainerSealant::m_logger [private] |
Referenced by ContainerSealant(), invoke(), and setMethodsExcludedFromInvocationLogging().
final String alma::acs::container::ContainerSealant::m_name [private] |
Referenced by ContainerSealant(), invoke(), and setMethodsExcludedFromInvocationLogging().
final Set<String> alma::acs::container::ContainerSealant::methodNamesExcludedFromInvocationLogging [private] |
1.6.2