com.ibm.security.certclient.base
Class PkSource
- java.lang.Object
com.ibm.security.certclient.base.PkSource
Direct known subclasses:
- public class PkSource
- extends Object
PkEvent
s. It contains functionality to add, remove and replace PkListeners
and to propagate events to the listener. Only one listener is allowed.
Author:
Rod Mancisidor
Field Summary
Modifier and Type | Field and Description |
---|---|
|
isInitialized
Boolean to protect against more than one initialization.
|
Constructor Summary
Constructor and Description |
---|
PkSource()
Create a
PkSource that has as its listener a PkSink.instance .
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
addPkListener(PkListener listener)
Adds a listener to this source.
|
|
init(int level,PkAttrs attrs)
Initialize this bean.
|
|
initialize(int level,PkAttrs attrs)
First method invoked on a bean.
|
|
initNext(int level,PkAttrs attrs)
Initialize the listener(s).
|
propagate(PkCertReqEvent req)
Propagates the request to the listener, returns whatever reply the
listener returns.
|
|
propagate(PkGnrlReqEvent req)
Propagates the request to the listener, returns whatever reply the
listener returns.
|
|
propagate(PkHttpReqEvent req)
Propagates the request to the listener, returns whatever reply the
listener returns.
|
|
propagate(PkInitReqEvent req)
Propagates the request to the listener, returns whatever reply the
listener returns.
|
|
propagate(PkKrecReqEvent req)
Propagates the request to the listener, returns whatever reply the
listener returns.
|
|
propagate(PkKupdReqEvent req)
Propagates the request to the listener, returns whatever reply the
listener returns.
|
|
propagate(PkPollReqEvent req)
Propagates the request to the listener, returns whatever reply the
listener returns.
|
|
propagate(PkReqEvent req)
Propagates the request to the listener, returns whatever reply the
listener returns.
|
|
propagate(PkRevoReqEvent req)
Propagates the request to the listener, returns whatever reply the
listener returns.
|
|
propagate(PkSecnReqEvent req)
Propagates the request to the listener, returns whatever reply the
listener returns.
|
|
propagate(PkXcerReqEvent req)
Propagates the request to the listener, returns whatever reply the
listener returns.
|
|
|
removePkListener(PkListener listener)
Removes the listener from this source.
|
|
replacePkListener(PkListener listener)
Replaces the current listener with a new one.
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail
isInitialized
- protected boolean isInitialized
Constructor Detail
PkSource
- public PkSource()
Create a
PkSource
that has as its listener a PkSink.instance
.
Method Detail
initialize
- public void initialize(int level,
- PkAttrs attrs)
- throws PkException
First method invoked on a bean. It can be used to initialize the bean.
This method may be invoked more than once. Beans that have been
positioned earlier in the pipeline have their init method invoked before
beans that come later in the pipeline, although the algorithm is
depth-first, so if there are distributors (
PkSwitch
,
PkIfThenElse
) in the pipeline, one branch will be fully
initialized before the other. The initialize
method is meant
to first invoke the init
method and then potentially invoke the
initialize method on the Pklistener
s to this bean.
Parameters:
level
- the level of the bean in the pipeline. 0 implies the bean
is a PkActiveSource
. 1 is given to the next bean
after the active source, and so on. attrs
- a set of parameters that can be used to place information
that is used by beans downstream during initialization. Throws:
init
- protected void init(int level,
- PkAttrs attrs)
- throws PkException
Initialize this bean. The default implementation is empty.
Parameters:
level
- the level of the bean in the pipeline. 0 implies the bean
is a PkActiveSource. 1 is given to the next bean
after the active source, and so on.
attrs
- a set of parameters that can be used to place information
that is used by beans downstream during initialization. Throws:
initNext
- protected void initNext(int level,
- PkAttrs attrs)
- throws PkException
Initialize the listener(s). The default implementation initializes the
listener as defined in
PkSource
.
Parameters:
level
- the level of the bean in the pipeline. 0 implies the bean
is a PkActiveSource. 1 is given to the next bean
after the active source, and so on.
attrs
- a set of parameters that can be used to place information
that is used by beans downstream during initialization. Throws:
propagate
- public final PkRepEvent propagate( PkReqEvent req)
- throws PkException
Propagates the request to the listener, returns whatever reply the
listener returns.
Throws:
propagate
- public final PkHttpRepEvent propagate( PkHttpReqEvent req)
- throws PkException
Propagates the request to the listener, returns whatever reply the
listener returns.
Throws:
propagate
- public final PkCertRepEvent propagate( PkPollReqEvent req)
- throws PkException
Propagates the request to the listener, returns whatever reply the
listener returns.
Throws:
propagate
- public final PkCertRepEvent propagate( PkCertReqEvent req)
- throws PkException
Propagates the request to the listener, returns whatever reply the
listener returns.
Throws:
propagate
- public final PkInitRepEvent propagate( PkInitReqEvent req)
- throws PkException
Propagates the request to the listener, returns whatever reply the
listener returns.
Throws:
propagate
- public final PkSecnRepEvent propagate( PkSecnReqEvent req)
- throws PkException
Propagates the request to the listener, returns whatever reply the
listener returns.
Throws:
propagate
- public final PkKupdRepEvent propagate( PkKupdReqEvent req)
- throws PkException
Propagates the request to the listener, returns whatever reply the
listener returns.
Throws:
propagate
- public final PkXcerRepEvent propagate( PkXcerReqEvent req)
- throws PkException
Propagates the request to the listener, returns whatever reply the
listener returns.
Throws:
propagate
- public final PkGnrlRepEvent propagate( PkGnrlReqEvent req)
- throws PkException
Propagates the request to the listener, returns whatever reply the
listener returns.
Throws:
propagate
- public final PkKrecRepEvent propagate( PkKrecReqEvent req)
- throws PkException
Propagates the request to the listener, returns whatever reply the
listener returns.
Throws:
propagate
- public final PkRevoRepEvent propagate( PkRevoReqEvent req)
- throws PkException
Propagates the request to the listener, returns whatever reply the
listener returns.
Throws:
addPkListener
- public void addPkListener(PkListener listener)
- throws TooManyListenersException
Adds a listener to this source. If there is already a listener, then
throw TooManyListenersException.
Parameters:
listener
- The listener to add. Throws:
TooManyListenersException
- if there is already a listener. removePkListener
- public void removePkListener(PkListener listener)
Removes the listener from this source. If the listener passed in is not
the current listener, then it fails silently.
Parameters:
listener
- The listener to remove. replacePkListener
- public void replacePkListener(PkListener listener)
Replaces the current listener with a new one.
Parameters:
listener
- The replacement listener.
Initialization always takes place in the context of a single thread, so this field needs no synchronization