Ponder2 WriteMO Specification File

This is a description of the format and possibilities of the WriteMO specification file for creating Ponder2 managed Objects. The simple example showing how to create a managed object shows only a few of the available options. All the options are shown here and discussed more fully.

Main Keywords/phrases

Keyword/Keyphrase

Format

Description

ManagedObject

ManagedObject <java class name>

Specifies the Java class name of the managed object to be created

Package

[Package <java package name>]

The package which this Java class should belong to. Optional, defaults to net.ponder2.managedobject

Create Attributes

Create Attributes

Introduces attributes on the following lines that may be used with the <create> command

Create Operations

Create Operations

Introduces operations on the following lines that may be used with the <create> command

Use Attributes

Use Attributes

Introduces attributes on the following lines that may be used with the <use> command

Use Operations

Use Operations

Introduces operations on the following lines that may be used with the <use> command

<operation> Attributes

<operation> Attributes

Introduces attributes on the following lines that may be used with the one of the operations previously declared

Operations

Operations follow the Create or Use Operations phrases and look like

<operation_name> [# comment]

The operation is called <operation_name> with an optional comment.

Attributes

Attributes follow the Create, Use or newly declared operations' Attributes phrases and look like

<attribute_name> [<type> [required | <default_value>]] [# comment]

The attribute name may be followed by the type (only String is currently implemented), the keyword required if it must be present or, optionally a default value. The line may be terminated by an optional comment. If required is used and the attribute is not present, an error will be generated. If a default is specified then if the attribute is not present, the managed object acts as if it were, with the default value.

Example

Suppose that the following is to be parsed

<use name="/template/myobj">
  <create epr="http://www.yahoo.com">
    <arg name="arg1" type="string"/>
    <arg name="arg2"/>
  </create>
</use>

The description would be (use would have a similar description)

ManagedObject Myobj
Create Attributes
epr String required # The end point reference that this object it to be attached to
Create Operations
arg # one for each argument that the object will expect
arg Attributes
name String required # the argument name
type String "string" # the argument type

Full Use Example

This is a WriteMO specification using all available constructs.

ManagedObject Trial
Package net.ponder2.managedobject.mymos
Create Attributes
name String required
epr String "http://fred.com"
count int        # Number of berries
Create Operations
notification     # Events that can be raised externally
operation        # Operations than can be invoked externally
notification Attributes
name String required # external name for this event
event            # internal name for the event
operation Attributes
name             # external name for this operation
localop          # internal operaton name in the for managedobject.operation
Use Attributes
seconds optional # The time the operation should take
Use Operations
list             # Lists the contents of the splurgeworthy haystack
call             # Calls through to the other side
list Attributes
extent String everything  # how much to list
format String true        # whether to format the output

Bugs


Ponder2Wiki: Ponder2WriteMOSpecification (last edited 2008-01-03 17:40:14 by localhost)