JeeWiz Home

 
  
 
Contents  >   7.  GigaSystemBuilder Profile Reference
 


7.17 Method Object

Used on
class
javaBean
service
DescriptionThis is the giga-spaces method with the initMethod and destroyMethod flags.
Contained
Lists
1
Name  annotation
Type  String
Description  An optional list, comma-separated, of Java annotations.

You can put the '@' as the first character on the annotation, but it is not necessary.

You can add the annotation as either

    • an XML element, with the CDATA being the annotation text
    • a property which can contain multiple annotations, comma-separated.
If you use the property form, you cannot add multiple element-pair values as the syntax conflicts with the comma-separation syntax. In other words, annotation="@Annotation(id=27,name='Fred')" will be parsed into two separate annotations, and then inserted into the code as "@Annotation(id=27" and "@name='Fred')", which is incorrect syntax.

Because of this, some modelling environments allow annotations to be added as a property (this is most convenient) and as a list (this allows complex annotations).
Unique  false
 
2
Name  parameter
Type  parameter
Description  This overrides the parameter list from the Java meta-model, so we get business-object level parameters.
Indexed property  name
 
3
Name  exception
Type  String
Description  Defines the exception(s) thrown by the method.

In the JeeWiz editor, multiple thrown exceptions may be specified in the 'exception' property using a comma separated list.

In XML, you can use one or more nested elements as an alternative to the 'exception=' property.

Any duplicate exceptions are ignored.
Unique  false
 
4
Name  typeParameter
Type  typeParameter
Description  A list of type-parameters on the method. For example, in the definition in Java 5 arrays:

static List asList( T... a )

the first would be represented by a type-parameter list with one TypeParameter entry - name="T", and no extends.

In the Java Language Specification (JLS), a type parameter is also referred to as "type variable", and this list is referred to as the "formal type parameters" for the method. They need not be provided explicitly when a generic method is invoked. Instead, they are almost always inferred.

By definition, a method is generic if there are one or more type parameters.

The parameters specified here are used to generate the method declaration.
GenerateAllList  false
Inherited
properties
template (base property)

text (base property)

jwpattern (base property)

 7.17.1  Property 'access'
 7.17.2  Property 'description'
 7.17.3  Property 'destroyMethod'
 7.17.4  Property 'initMethod'
 7.17.5  Property 'logReturnValue'
 7.17.6  Property 'name'
 7.17.7  Property 'returnType'
 7.17.8  Property 'synchronized'

7.17.1  Property 'access'
DescriptionSpecifies the access control for the attribute.

The default access is specifically null, so that there is no access control value placed in the code. This is necessary because the default for the access changes depending on the context.
TypeString
Choices private (default)
protected
public
Default\null

7.17.2  Property 'description'
DescriptionOptional description.

Use this to
  1. document the meaning of a particular item
  2. specify functionality at the design stage for implementation later.
TypeString

7.17.3  Property 'destroyMethod'
DescriptionSet this to true to make this method the destroyMethod for the service.

An destroyMethod using the default name for the destroy method can be created by setting the 'generateDestroyMethod' flag in the parent 'service' object.

This must not be set on an abstract class because that cannot be instantiated (in order to inject an instance into the PU).
Typeboolean
Defaultfalse

7.17.4  Property 'initMethod'
DescriptionSet this to true to make this method the initMethod for the bean or class.

An initMethod is initiated as the containing processing unit is started (before any services or spaces are guaranteed to be available) and should therefore be used only for local processing.

An initMethod using the default name for the init method can be created by setting the 'generateInitMethod' flag in the parent 'service' object.

This must not be set on an abstract class because that cannot be instantiated (in order to inject an instance into the PU).
Typeboolean
Defaultfalse

7.17.5  Property 'logReturnValue'
DescriptionThis tells the generator to generate a wrapper for the method that

    • declares a 'returnValue' variable, in the wrapper, with a null value appropriate to the type

    • lets the programmer set it in the business logic

    • logs the returned value at detailed debug level

    • then returns the value as the returnValue of the method.
So, instead of saying e.g. "return 1", the programmer writes "returnValue = 1" and the generated wrapper will log this value and then return it as the result of the method.

This flag does not have any effect for void methods.

This is a delegated flag and is present on methods, classes, jars and applications.

An overall default for the complete application can be set by defining a value in the system.properties for an application (using $booleanTrue or $booleanFalse) for
Typeboolean
Defaultfalse

7.17.6  Property 'name'
DescriptionSpecifies the name of the method.
TypeString
Requiredtrue

7.17.7  Property 'returnType'
DescriptionSpecifies the method's return type. The default is 'void'.

For value-returning methods, the return type may be any primitive type or interface/class name, whether alone or qualified by a package name.
TypeString
Defaultvoid

7.17.8  Property 'synchronized'
DescriptionThis is the Java 'synchronized' modifier for methods. In C#, it will be turned into 'lock' or 'MethodImplOptions.Synchronized' as appropriate.
Typeboolean
Defaultfalse

Copyright (c) 2001-2009 New Technology/enterprise Ltd.