@NotThreadSafe public abstract static class Receptionist.Abstract extends Object implements Receptionist
Receptionist.Abstract
Modifier and Type | Field and Description |
---|---|
static ElapsedTime |
DEFAULT_WAIT
Default wait.
|
static String |
WAIT_PROPERTY
The maximum time in millis to wait for an additional notice when at
least one has been accepted for processing.
|
Constructor and Description |
---|
Abstract() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the input Queue.
|
void |
commit()
Registers that the notices have been processed.
|
protected abstract void |
doClose()
Closes the input Queue.
|
protected abstract void |
doCommit()
Registers that the notices have been processed.
|
protected abstract Optional<PointValue> |
doFetchNotice(int limit,
long wait)
Fetches a notice.
|
protected abstract void |
doOpen()
Opens the input Queue.
|
protected abstract void |
doRollback()
Forgets that the notices have been received.
|
List<PointValue> |
fetchNotices(int limit,
long wait)
Fetches notices.
|
protected Metadata |
getMetadata()
Gets the metadata.
|
protected Logger |
getThisLogger()
Gets the logger.
|
void |
open()
Opens the input Queue.
|
long |
receptionTime()
Returns and resets the reception time.
|
void |
rollback()
Forgets that the notices have been received.
|
boolean |
setUp(Metadata metadata)
Sets up access to the messaging system.
|
void |
tearDown()
Tears down what has been set up.
|
public static final ElapsedTime DEFAULT_WAIT
public static final String WAIT_PROPERTY
public final void close()
close
in interface Receptionist
public final void commit() throws InterruptedException, ServiceNotAvailableException
commit
in interface Receptionist
InterruptedException
- When the service is stopped.ServiceNotAvailableException
- When the service is not available.public List<PointValue> fetchNotices(int limit, long wait) throws InterruptedException, ServiceNotAvailableException
fetchNotices
in interface Receptionist
limit
- The limit for the number of notices.wait
- Negative is forever, 0 is no wait, other is milliseconds.InterruptedException
- When the service is stopped.ServiceNotAvailableException
- When the service is not available.public final void open()
open
in interface Receptionist
public final long receptionTime()
receptionTime
in interface Receptionist
public final void rollback() throws InterruptedException, ServiceNotAvailableException
rollback
in interface Receptionist
InterruptedException
- When the service is stopped.ServiceNotAvailableException
- When the service is not available.public boolean setUp(Metadata metadata)
setUp
in interface Receptionist
metadata
- The processor metadata.public void tearDown()
tearDown
in interface Receptionist
protected abstract void doClose()
Called while synchronized on this. May be called while already closed.
protected abstract void doCommit() throws InterruptedException, ServiceNotAvailableException
Called while synchronized on this.
InterruptedException
- When the Service is stopped.ServiceNotAvailableException
- When the service is not
available.@Nonnull @CheckReturnValue protected abstract Optional<PointValue> doFetchNotice(int limit, long wait) throws InterruptedException, ServiceNotAvailableException
limit
- The read ahead limit.wait
- Negative is forever, 0 is no wait, other is milliseconds.InterruptedException
- When the Service is stopped.ServiceNotAvailableException
- When the service is not
available.protected abstract void doOpen()
Called while synchronized on this.
protected abstract void doRollback() throws InterruptedException, ServiceNotAvailableException
InterruptedException
- When the Service is stopped.ServiceNotAvailableException
- When the service is not
available.@Nonnull @CheckReturnValue protected Metadata getMetadata()
@Nonnull @CheckReturnValue protected final Logger getThisLogger()
Copyright © 2003-2019 Serge Brisson. All Rights Reserved.