public class SharedObjectService extends Object implements ISharedObjectService
| Modifier and Type | Field and Description |
|---|---|
static int |
MAXIMUM_EVENTS_PER_UPDATE
Maximum messages to send at once
|
BEAN_NAME| Constructor and Description |
|---|
SharedObjectService() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
clearSharedObjects(IScope scope,
String name)
Deletes persistent shared objects specified by name and clears all properties from active shared objects (persistent and nonpersistent).
|
boolean |
createSharedObject(IScope scope,
String name,
boolean persistent)
Create a new shared object.
|
ISharedObject |
getSharedObject(IScope scope,
String name)
Get a shared object by name.
|
ISharedObject |
getSharedObject(IScope scope,
String name,
boolean persistent)
Get a shared object by name and create it if it doesn't exist.
|
Set<String> |
getSharedObjectNames(IScope scope)
Get a set of the shared object names.
|
boolean |
hasSharedObject(IScope scope,
String name)
Check if a shared object exists.
|
void |
setMaximumEventsPerUpdate(int maximumEventsPerUpdate) |
void |
setPersistenceClassName(String name)
Setter for persistence class name.
|
static void |
setScheduler(ThreadPoolTaskScheduler scheduler) |
static void |
submitTask(Runnable task)
Pushes a task to the scheduler for single execution.
|
public static int MAXIMUM_EVENTS_PER_UPDATE
public static void submitTask(Runnable task)
task - runnablepublic void setMaximumEventsPerUpdate(int maximumEventsPerUpdate)
maximumEventsPerUpdate - the maximumEventsPerUpdate to setpublic void setPersistenceClassName(String name)
name - Setter for persistence class namepublic static void setScheduler(ThreadPoolTaskScheduler scheduler)
scheduler - the scheduler to setpublic boolean createSharedObject(IScope scope, String name, boolean persistent)
createSharedObject in interface ISharedObjectServicescope - the scope to create the shared object inname - the name of the shared objectpersistent - will the shared object be persistenttrueif the shared object was created or already exists, otherwise
false
public ISharedObject getSharedObject(IScope scope, String name)
getSharedObject in interface ISharedObjectServicescope - the scope to get the shared object fromname - the name of the shared objectnullif not found
public ISharedObject getSharedObject(IScope scope, String name, boolean persistent)
getSharedObject in interface ISharedObjectServicescope - the scope to get the shared object fromname - the name of the shared objectpersistent - should the shared object be created persistentpublic Set<String> getSharedObjectNames(IScope scope)
getSharedObjectNames in interface ISharedObjectServicescope - the scope to return the shared object names frompublic boolean hasSharedObject(IScope scope, String name)
hasSharedObject in interface ISharedObjectServicescope - the scope to check for the shared objectname - the name of the shared objecttrueif the shared object exists, otherwise
false
public boolean clearSharedObjects(IScope scope, String name)
Deletes persistent shared objects specified by name and clears all properties from active shared objects (persistent and nonpersistent). The name parameter specifies the name of a shared object, which can include a slash (/) as a delimiter between directories in the path. The last element in the path can contain wildcard patterns (for example, a question mark [?] and an asterisk [*]) or a shared object name. The clearSharedObjects() method traverses the shared object hierarchy along the specified path and clears all the shared objects. Specifying a slash (/) clears all the shared objects associated with an application instance.
The following values are possible for the soPath parameter:
/ clears all local and persistent shared objects associated with the instance.
/foo/bar clears the shared object /foo/bar; if bar is a directory name, no shared objects are deleted.
/foo/bar/* clears all shared objects stored under the instance directory /foo/bar. The bar directory is also deleted if no persistent shared objects are in use within this namespace.
/foo/bar/XX?? clears all shared objects that begin with XX, followed by any two characters. If a directory name matches this specification, all the shared objects within this directory are cleared.
If you call the clearSharedObjects() method and the specified path matches a shared object that is currently active, all its properties are deleted, and a "clear" event is sent to all subscribers of the shared object. If it is a persistent shared object, the persistent store is also cleared.
clearSharedObjects in interface ISharedObjectServicescope - the scope to check for the shared objectname - the name of the shared objectCopyright © 2005–2017 Red5. All rights reserved.