JeeWiz Home

 
  
 
Contents  >   7.  GigaSystemBuilder Profile Reference
 


7.3 Browser Object

Used on
processingUnit
DescriptionThis is the event that looks at entries in a space, without necessarily removing them. It is equivalent to a queue browser in J2EE JMS or Spring.

In GigaSpaces, it maps to a polling container with an Single*Read* receive handler. For the duration of this call, no other method will get access to the object in the space.

Only the write of an entry into the space causes this type of event; updates do not.

You must take care when using the browser that there is some way of stopping the event from continually being triggered; if you do not do this, the GigaSpaces infrastructure will continually call the browser method.

The business method that is generated is placed on the PU's actions class, which has the extension '_Actions', and is named using Java conventions. For example, if the PU name 'MyPU' and the subscriber is named "Sub-a1" then the method will be 'MyPU_Actions.subA1()'.

Currently, this event does not use a transaction; let NT/e know if you have a use-case that needs it.

The FIFO aspect of the order of objects retrieved by a browser is determined by the type of object being retrieved or the space. The simple pattern here is to define a specific JavaBean for the browser to read and then set the FIFO property on that.
Inherited
properties
template (base property)

text (base property)

jwpattern (base property)

 7.3.1  Property 'allowInPartitionedPU'
 7.3.2  Property 'description'
 7.3.3  Property 'handler'
 7.3.4  Property 'name'
 7.3.5  Property 'space'
 7.3.6  Property 'sqlQueryWhereClause'
 7.3.7  Property 'templateBean'
 7.3.8  Property 'templateValues'
 7.3.9  Property 'useRemoteSpace'

7.3.1  Property 'allowInPartitionedPU'
DescriptionDefines whether this event can be used in a partitioned PU. The issue here is that if the event is in a partitioned PU, then each event in the space will cause an action in every partition: the same event will trigger threads in each space to run the event.

This flag is ignored if the space is local to the event's PU and the 'useRemoteSpace' flag is false (which is the default); in this case, there will be an event handler in each partition instance, but it will only react to events in the local space.

Note that use of this flag is likely to be the unusual case. We expect the normal cases to be a

    • a local space with 'useRemoteSpace' set to false, so each data event causes only one program event across the whole cluster

    • a remote space cause events in a PU that is not partitioned, so allowInPartitionedPU can be false.
If the PU containing this event is partitioned in a particular deploymentOption, the following cases result in an error when the deployment is created:

    • the space is local, useRemoteSpace is true and allowInPartitionedPU is false

    • the space is remote and allowInPartitionedPU is false.
Typeboolean
Defaultfalse

7.3.2  Property 'description'
TypeString

7.3.3  Property 'handler'
DescriptionThe handler that is configured for an event affects the performance and functionality of the action. By default, GigaSystemBuilder configures event handlers as follows:

    • use the 'read' operation rather 'take' from the space. This is because if you take from the space and it is backed-up, then the entry will be lost if the primary crashes.

    • not to use transactions. This is because other operations must be performed using the same transaction manager and GigaSystemBuilder doesn't support this yet.

    • to read in batches of 10. This gives near-optimal performance.

    • to be notified only on write, and update if specified (subscribers only).
As configuring the handler is a complicated area, GigaSystemBuilder allows you to override the standard generated handler with your own and specifying the expression here. A common way of doing this is the specify a getter method in the "Additional Code" area of the PU's "...Actions" class. If this were called "getSpecialHandler", then you would specify handler="getSpecialHandler()".
TypeString

7.3.4  Property 'name'
DescriptionThe name of the action. This must be unique across all other actions (and pulses) within the PU.
TypeString
Requiredtrue

7.3.5  Property 'space'
DescriptionThe space that this event happens in.
TypeString
Requiredtrue

7.3.6  Property 'sqlQueryWhereClause'
DescriptionThe where clause of the SQL query to use for this event. See templateBean for more details.

You cannot use this in conjunction with a templateValues setting.
TypeString

7.3.7  Property 'templateBean'
DescriptionThe templateBean defines the type of object (POJO/JavaBean) that triggers this event. It must be specified.

You can further restrict the set of objects that trigger the event by using one (but not both) of the following:

    • set the templateValues property, with additional settings for the fields in the bean

    • set the sqlQueryWhereClause. In this case, instances of the bean must also match the specified SQL query to cause the event.
TypeString
Requiredtrue

7.3.8  Property 'templateValues'
DescriptionThe templateValues is a list of initialisation values for fields in the template bean.

For example, if you want only beans with the field f equal to 2, specify "f=2".

If you need to specify two or more values, separate them with ';', e.g. "f=2; g=NEEDS_WASHING".

Only use the name of the field on the left-hand-side.

You cannot use this in conjunction with the sqlQueryWhereClause.
TypeString

7.3.9  Property 'useRemoteSpace'
DescriptionThis flag is ignored if this event and its target space are in different PUs - i.e. they are remote to each other.

If this event and its target space are in the same PU - they are local to each other -

    • if this flag is false it means that the space should be referenced using a local URL, which means that only data changes from the local space will trigger the event.

    • if this flag is set true, then a remote URL is used to access the space, meaning that data changes from the complete space will trigger the event. See the "allowInPartitionedPU" flag for further details of this.
Typeboolean
Defaultfalse

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