|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.novanic.eventservice.client.event.domain.DefaultDomain
public final class DefaultDomain
Domains/contexts are used to specify the range where events should occur and listened. That supports the reuse of
events (Event and listeners (RemoteEventListener.
Example:
Your application is a multiplayer online game with a conversation system. You defined the following events and
listeners.
Events: NewUserEvent
Listeners: ConversationListener, ConversationChannelListener, PlayerListListener
It makes sense to divide your elements into different domains, to ensure that a NewUserEvent affects only the right
context/domain. For example one conversation domain and one game domain. ConversationListener and
ConversationChannelListener should be added to the conversation domain and the PlayerListListener should be added to
the game domain. Now you can distinguish the context of the NewUserEvent. If a user joined a conversation (NewUserEvent
added to conversation domain), the two conversation listeners will recognize it and the PlayerListListener won't be
informed about the NewUserEvent in the conversation context/domain.
| Constructor Summary | |
|---|---|
DefaultDomain()
Deprecated. That constructor is only for serialization! Please use DefaultDomain(String) instead. |
|
DefaultDomain(java.lang.String aName)
Creates a new domain with a specified name. |
|
| Method Summary | |
|---|---|
int |
compareTo(Domain aDomain)
|
boolean |
equals(java.lang.Object anObject)
|
java.lang.String |
getName()
Return the name of the domain. |
int |
hashCode()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
@Deprecated public DefaultDomain()
DefaultDomain(String) instead.
DefaultDomain(String)public DefaultDomain(java.lang.String aName)
aName - unique domain name| Method Detail |
|---|
public java.lang.String getName()
getName in interface Domainpublic int compareTo(Domain aDomain)
compareTo in interface java.lang.Comparable<Domain>public boolean equals(java.lang.Object anObject)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||