public class EventTypeGenerator extends Object implements Serializable
EventType
objects. All
EventType
objects created by the same generator (or
associated with the same generator by a
EventType.restoreTransientState call) will use the same
thread pool to manage their event send threads.
EventType
,
EventType.restoreTransientState(com.sun.jini.norm.event.EventTypeGenerator, com.sun.jini.norm.event.SendMonitor, net.jini.security.ProxyPreparer)
,
Serialized FormModifier and Type | Field and Description |
---|---|
private long |
nextEvID
Next event ID.
|
private static long |
serialVersionUID |
private TaskManager |
taskManager
Task manager used to send events
|
private WakeupManager |
wakeupManager
Wakeup manager used by the event sending tasks to schedule
retries.
|
Constructor and Description |
---|
EventTypeGenerator() |
Modifier and Type | Method and Description |
---|---|
(package private) TaskManager |
getTaskManager()
Return the task manager that
EventType objects created
by this generator should use to send their events. |
(package private) WakeupManager |
getWakeupManager()
Return the wakeup manager that
EventType objects created
by this generator should use to send their events. |
EventType |
newEventType(SendMonitor monitor)
Create a new
EventType object. |
EventType |
newEventType(SendMonitor monitor,
long eventID)
Create a new
EventType object specify the
event id it should have. |
private void |
readObject(ObjectInputStream in)
Override
readObject to create a TaskManager
and a WakeupManager . |
(package private) void |
recoverEventID(long evID)
Called by event types during transient state recovery to ensure
the generator knows about there event ID.
|
void |
terminate()
Terminate any independent treads started by event types
associated with this generator.
|
private static final long serialVersionUID
private long nextEvID
private transient TaskManager taskManager
private transient WakeupManager wakeupManager
public EventType newEventType(SendMonitor monitor) throws IOException
EventType
object. The event ID for
this type will be generated by this call.monitor
- Object to callback when an event sending
attempt fails with a definite exception and to
ensure that the lease on the event is still current.
May not be null
.EventType
objectIOException
- if listener cannot be serializedpublic EventType newEventType(SendMonitor monitor, long eventID) throws IOException
EventType
object specify the
event id it should have.eventID
- the event ID of this typemonitor
- Object to callback when an event sending
attempt fails with a definite exception and to
ensure that the lease on the event is still current.
May not be null
.EventType
objectIOException
- if listener cannot be serializedvoid recoverEventID(long evID)
Note: this method is not synchronized.
evID
- event ID of recovered EventType
objectTaskManager getTaskManager()
EventType
objects created
by this generator should use to send their events.WakeupManager getWakeupManager()
EventType
objects created
by this generator should use to send their events.public void terminate()
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
readObject
to create a TaskManager
and a WakeupManager
.IOException
ClassNotFoundException
ObjectInputStream.defaultReadObject()
Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.