A JavaScript library wrapping
Packages.helma.extensions.helmagroups
To use this optional module, its repository needs to be added to the application, for example by calling app.addRepository('modules/helma/Group.js')
To use this optional module, its repository needs to be added to the application, for example by calling app.addRepository('modules/helma/Group.js')
Constructs a new helma.Group Object.
parameters
| FIXME | javaGroup | FIXME |
methods
- set(key, val, sendMode)
- remove(key, sendMode)
- get(key)
- callFunction(method, argArr, sendMode)
Constructs a new helma.Group.GroupObject.
parameters
| Object | Instance | of helma.extensions.helmagroups.GroupObject |
methods
- set(key, The, The)
- remove(key, The)
- get(key)
- getProperty(key)
- wrap(The)
- unwrap()
- isLocal()
This is mounted as "groups".
methods
- get(name)
- checkWriteAccess(nameOrJGroup)
- connect(name)
- disconnect(name)
- reconnect(name)
- reset(name)
- destroy(name)
- restart(name)
- listMembers(name)
- listMemberApps(name)
- getContent(name)
- getFullContent(name)
- getConfig(name)
- getFullConfig(name)
- getConnection(name)
- isConnected(name)
- size(name)
- count(name)
Static properties of GroupObject constructor function.
These values determine if and for how many confirmation of the
group members this instance waits after a modification.
These values are passed through to org.jgroups.blocks.GroupRequest,
for further comments see the sourcecode of that class
Methods
sets a key/value pair on the group's root,
wraps the function of the wrapper object
parameters
| key | ||
| val | ||
| sendMode |
removes a key from the group's root,
wraps the function of the root GroupObject
parameters
| key | ||
| sendMode |
retrieves a key from the group's root,
wraps the function of the root GroupObject
parameters
| key |
calls a function in all connected applications
(to be specific: in all registered localClients).
parameters
| method | name of the method in xmlrpc-style: test is called as root.test(), stories.137.render is called as root.stories.get("137").render() etc etc. | |
| argArr | array of arguments to the remote method | |
| sendMode | as defined for helma.Group.GroupObject |
returns
| array of result objects |
Returns the wrapped java GroupObject.
returns
| Instance of helma.extensions.helmagroups.GroupObject; |
Sets a property or a child GroupObject in this instance.
The Key may be a String, an Array or a String with separator characters ("/").
In the latter two cases the argument is considered a path and
all GroupObjects along this path are created if necessary.
parameters
| Object | key |
Either
|
| Number | The | value to set the property to. |
| Object | The | mode to use when committing the change to the helma.Group |
Removes a property or a child GroupObject from this instance.
The Key may be a String, an Array or a String with separator characters ("/").
In the latter two cases the argument is considered a path and
the function walks down that path to find the GroupObject and
deletes it.
parameters
| Object | key |
Either
|
| Number | The | mode to use when committing the change to the helma.Group |
Returns either a property or a child GroupObject from
this GroupObject instance. The key passed as argument
may be a String, an Array containing Strings or a
String containing separator characters ("/"). In the latter
two cases the argument is considered a path and
the function walks down that path to find the requested
GroupObject.
parameters
| Object | key |
Either
|
returns
| Depending on the argument either the appropriate property value or a helma.Group.GroupObject |
Gets a property from this GroupObject. The key passed as argument
is always considered a property even if it contains a slash.
This is actually a workaround for the fact that other
instances of the group not using the javascript extension aren't forbidden
to add properties containing a slash in the property's name.
So, using this extension we can at least read the property.
parameters
| String | key | The name of the property to return |
returns
| The value of the property |
Exchanges this GroupObject with the one passed
as argument. This is done by exchanging the wrapped
instance of helma.extensions.helmagroups.GroupObject
parameters
| GroupObject | The | GroupObject to use |
returns
| The GroupObject with the exchanged wrapped java object |
Clones this GroupObject and returns it.
This method should be considered if many properties
of a GroupObject must be set or modified since every
change to an already replicated GroupObject will
result in immediate network traffic. Using unwrap
one can modify several properties and then commit
the GroupObject at once using {@link #wrap).
returns
| A clone of this GroupObject |
Converts this GroupObject into a vanilla Object
returns
| An Object containing all properties of this GroupObject |
Returns an Array containing all child GroupObjects
returns
| An Array containing GroupObjects |
Returns an Array containing all property
names of this GroupObject instance
returns
| An Array containing property names |
Returns the number of child GroupObjects
returns
| The number of child GroupObjects of this helma.Group.GroupObject instance |
Returns the number of properties of this GroupObject
returns
| The number of properties |
Returns true if the GroupObject is not replicated
returns
| True if this GroupObject is still local |
visible to scripting env: get a group, wrapped as a javascript helma.Group object.
the group must be defined in app.properties: group.nameXX =
and can then be accessed like this group.get("nameXX")
parameters
| name |
returns
| null if group is not defined or not connected |
checks for write access to a group according to app.properties
group.nameXX.writable must be true so that this function returns
parameters
| nameOrJGroup | can be the name of a group or a java Group itself |
exceptions
| an error if group is not writable |
try to connect a group
parameters
| name |
returns
| false if group is not found |
try to disconnect from a group
parameters
| name |
returns
| false if group is not found |
try to disconnect and connect again to a group
parameters
| name |
returns
| false if group is not found |
try to reset a group (if application may write in group).
all instances of the group empty their cache.
parameters
| name |
returns
| false if group is not found |
try to destroy a group (if application may write in group).
all other instances of the group disconnect
parameters
| name |
returns
| false if group is not found |
try to restart a group (if application may write in group).
all other instances of the group disconnect and reconnect - each app after a different pause
so that they don't all come up at the same moment
parameters
| name |
returns
| false if group is not found |
list the members of this group (ie instances of Group, one helma server is one instance)
parameters
| name |
returns
| array of strings, false if group is not found |
lists the members applications of this group (may be more than one per instance but also none)
parameters
| name |
returns
| array of strings, false if group is not found |
dumps the keys of the group to a string
parameters
| name |
returns
| string, notice if group is not found |
dumps the keys and the content of the group to a string
parameters
| name |
returns
| string, notice if group is not found |
dumps the config of the jgroups stack to a string
parameters
| name |
returns
| string, false if group is not found |
dumps the config of the jgroups stack including all properties to a string
parameters
| name |
returns
| string, false if group is not found |
returns the connection identifier of the Group instance (localname + multicast-target)
parameters
| name |
returns
| string, false if group is not found |
returns the total number of groupobjects in this group
parameters
| name |
returns the total number of groupobjects in this group
parameters
| name |
