|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--org.omus.core.Group
Represents a group of users. For each group that will be created due to an entry in config.xml
or dynamically by a client, an instance of Group will be created. The only way to obtain a reference
to a Group instance is the groupCreated method in org.omus.ext.GroupExtension.
The Java Group class is similar to the ActionScript Group object in the Client API.
| Method Summary | |
boolean |
addCommand(Command com)
Adds the specified command to the queue of this group for later execution. |
void |
close()
Closes the group so that no other users can join. |
java.util.Iterator |
getAllUsers()
Returns an Iterator over all the User instances of this group. |
java.lang.String |
getConfigID()
Returns the configID of the group. |
java.lang.String |
getName()
Returns the name of the group. |
PropertySet |
getProperties()
Returns the PropertySet object associated with this group. |
User |
getUser(java.lang.String username)
Returns the User object identified by the specified user name. |
int |
getUserCount()
Returns the number of users who are currently member of this group. |
int |
getUserLimit()
Returns the maximum number of users permitted for this group. |
boolean |
isClosed()
Returns true if the group is closed so that no other users can join. |
boolean |
isFull()
Returns true if the maximum number of users has been reached. |
void |
open()
Opens the group for other users to join. |
void |
sendToClients(Message msg)
Sends the specified Message to all the clients in this group. |
void |
sendToClients(Message msg,
User exclude)
Sends the specified Message to all the clients in this group except for the specified user. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public boolean addCommand(Command com)
final String result = null;
Command com1 = new Command () {
public void execute () {
result = aTimeConsumingCalculation();
Command com2 = new Command () {
public void execute () {
PropertySet ps = group.getProperties();
StringField st = (StringField)ps.getValue("foo");
st.setString(result);
}
};
group.addCommand(com2);
}
};
Services.getTaskManager.executeNow(com1);
With this approach you avoid to slow down the group queue with your time consuming calculation, but are
still able to pass its result to one of the protected methods.public java.lang.String getConfigID()
public java.lang.String getName()
public boolean isFull()
public boolean isClosed()
public int getUserLimit()
public PropertySet getProperties()
public int getUserCount()
public User getUser(java.lang.String username)
public java.util.Iterator getAllUsers()
public void open()
public void close()
public void sendToClients(Message msg)
onMessage event handler
in the client side Messenger object.
public void sendToClients(Message msg,
User exclude)
onMessage event handler in the client
side Messenger object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||