JeeWiz Home

 
  
 
Contents  >   7.  GigaSystemBuilder Profile Reference
 


7.4 BusinessMethod Object

Used on
service
DescriptionA business method in GigaSpaces modelling is a method that can be called by an external client.

In other words, where the 'event' is a program call from the external client.

The business method must be exposed (in the GigaSpaces configuration) so the client can reach it.

Whereas in standard business object modelling the session or service is always the element modelled, in GigaSpaces the business method can also be modelled independently of a service (although services with business methods can still be modelled).

Business methods are collected into a default service implementation class for the space.
Contained
Lists
1
Name  businessMethodParameter
Type  businessMethodParameter
GenerateAllList  true
 
2
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
 
3
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.4.1  Property 'allowMultiProcessing'
 7.4.2  Property 'description'
 7.4.3  Property 'logReturnValue'
 7.4.4  Property 'name'
 7.4.5  Property 'returnType'
 7.4.6  Property 'routingStyle'
 7.4.7  Property 'synchronized'
 7.4.8  Property 'uid'

7.4.1  Property 'allowMultiProcessing'
DescriptionSet this flag to allow multiple invocations of a thread on a business service (i.e. a business method on a service - this object).

By default, GigaSystemBuilder generates code to restrict services to run in a serialised way, so that in a given PU, there can never be more than one instance of the business method running at once. If the service becomes backlogged, it is likely that GigaSpaces will automatically create more threads ... but they will in fact block on the synchronization lock created by GigaSystemBuilder.

In some cases, this is the correct model for creating a service, but in other cases you want to allow multi-threading. To do this, set this flag true. When the flag is set, GigaSystemBuilder will not generate the synchronization lock and then multiple threads can process the method simultaneously.

If you set this flag, the programmer is responsible for any inter-thread synchronization required by the application.
Typeboolean
Defaultfalse

7.4.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.4.3  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.4.4  Property 'name'
DescriptionSpecifies the name of the method.
TypeString
Requiredtrue

7.4.5  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.4.6  Property 'routingStyle'
DescriptionThis property is only relevant for business-methods in GigaSpaces and defines how calls to the service are going to be routed in a partitioned PU.

'routed' means that a call to this service method will be routed based on information in the call. This can be specified

    • implicitly, by passing a parameter holding a modelled JavaBean in the call that has a 'routing' field set. In this case, there can only be one such JavaBean or an "ambiguous" error message is given.

    • explicitly, by setting the 'routing' flag on one of the parameters. If the parameter is an object, it must be a JavaBean and have exactly one of its fields marked with the 'routing' flag true.
'broadcast' means that the call will be delivered to all PU instances in the partitioned cluster. Any routing flags set in the parameters or the objects passed are ignored.

The other option is 'random', in which no routing information is specified and the call is delivered to one partition instance chosen at random.
TypeString
Choices routed (default)
broadcast
random
Requiredtrue

7.4.7  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

7.4.8  Property 'uid'
DescriptionThe 'uid' is a Unique IDentifier for reference-types (interfaces and classes) and methods in the business object model (and derivatives like J2EE).

The 'uid' uniquely identifies an object, even if the name (or signature of a method etc.) changes.

This will normally be generated by a modelling tool; if not, it should be generated by the transform for a modelling format into JeeWiz native format.

Even if the uid is not put on a meta-class as a property, the transform to JeeWiz native format currently generates one anyway.

This should be based on a UUID or GUID type of structure (i.e. globally unique), but may need additional embellishment when generating classes from patterns (so will not adhere to the UUID standard). The standard renderings use '@' as a separator for these generated uid's. ':', quotes and other XML special characters should definitely not be used.
TypeString

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