LogoutEvent.java
/***************************************************************************
Copyright 2013 Emily Estes
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
***************************************************************************/
package net.metanotion.authident;
/** This class represents a "logout event" for state machines.
When a user logs out, the state machine is sent an instance of this
class. This class is merely a marker for the event and has no state
or meaningful methods. To check for a LogoutEvent the
best technique would be to use "instanceof". While it's not in the
cards today, this class may be converted to something more
interesting, including an interface, and it is reasonble to assume that
"instanceof" will be the most useful way to futureproof semantic
usage of this class. */
public final class LogoutEvent {
/** This is merely a utility. Since this class has no meaningful
state, it's reasonable to just reuse the same instance to avoid
creating garbage, and allow the incredibly horrible idea of being
able to say "event == LogoutEvent.LOGOUT". Don't do that.
This is NOT a "Singleton". Use "instanceof" to "compare"
an event to this object. */
public static final LogoutEvent LOGOUT = new LogoutEvent();
}