org.netbeans.modules.bpel.model.api
Interface BpelModel

All Superinterfaces:
Model<BpelEntity>, Referenceable
All Known Implementing Classes:
BpelModelImpl

public interface BpelModel
extends Model<BpelEntity>

This interface is start point for BPEL model access. It contain root element - process that correspond to process in BPEL file. One should keep reference to this interface instead of keeping reference to process element, because reference to process element could mutate ( it is up to implementation ).

Author:
ads

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.netbeans.modules.xml.xam.Model
Model.State
 
Field Summary
static java.lang.String STATE
          This is pseudo property for event that fired when state of OM is changed.
 
Fields inherited from interface org.netbeans.modules.xml.xam.Model
STATE_PROPERTY
 
Method Summary
 void addEntityChangeListener(ChangeEventListener listener)
          Add change listener which will receive events for any element in the underlying model.
 boolean canExtend(ExtensibleElements extensible, java.lang.Class<? extends ExtensionEntity> extensionType)
           
 BpelEntity findElement(int i)
          Finds Bpel element on the specified position.
 AnotherVersionBpelProcess getAnotherVersionProcess()
          Accessor to root bpel process element that has different version from currently supported.
 BPELElementsBuilder getBuilder()
           
 BpelEntity getEntity(UniqueId id)
          Returns entity by its unique id.
 Process getProcess()
           
<V> V
invoke(java.util.concurrent.Callable<V> action, java.lang.Object source)
          This method should be used for executing group of calls to model as atomic action.
 void invoke(java.lang.Runnable run)
          This method execute command run inside read lock on OM obtained.
 void removeEntityChangeListener(ChangeEventListener listener)
          Removes change listener from model.
 
Methods inherited from interface org.netbeans.modules.xml.xam.Model
addChildComponent, addComponentListener, addPropertyChangeListener, addUndoableEditListener, addUndoableRefactorListener, endTransaction, getModelSource, getState, inSync, isIntransaction, removeChildComponent, removeComponentListener, removePropertyChangeListener, removeUndoableEditListener, removeUndoableRefactorListener, startTransaction, sync
 

Field Detail

STATE

static final java.lang.String STATE
This is pseudo property for event that fired when state of OM is changed.

See Also:
Constant Field Values
Method Detail

getProcess

Process getProcess()
Returns:
reference to root of BPEL - process.

getBuilder

BPELElementsBuilder getBuilder()
Returns:
builder for BPEL elements.

getEntity

BpelEntity getEntity(UniqueId id)
Returns entity by its unique id.

Parameters:
id - id of entity.
Returns:
entity by its id.

getAnotherVersionProcess

AnotherVersionBpelProcess getAnotherVersionProcess()
Accessor to root bpel process element that has different version from currently supported. Please note that this is only read-only element. You should not try to change it in any way. This method will return each time new instance of such root element. This method will return null if bpel process has correct namespace or not well formed ( in terms of XML ).

Returns:
OM root element that correspond to BPEL process with different version if any.

canExtend

boolean canExtend(ExtensibleElements extensible,
                  java.lang.Class<? extends ExtensionEntity> extensionType)

addEntityChangeListener

void addEntityChangeListener(ChangeEventListener listener)
Add change listener which will receive events for any element in the underlying model. Listener adds to model as weak reference. So one needs to care about keeping reference to listener somehere till it used and need to get events from model. If one will use anonymous class for adding then it will never get events. You should use method removePropertyChangeListener when listener is already not needed. For using this method you should keep reference to created listener. If you cannot use method removePropertyChangeListener then probably you will never get events from model because you don't keep reference to listener and it could be collected by GC in any time.

Parameters:
listener - listener for add.

removeEntityChangeListener

void removeEntityChangeListener(ChangeEventListener listener)
Removes change listener from model.

Parameters:
listener - listener for remove.

invoke

<V> V invoke(java.util.concurrent.Callable<V> action,
             java.lang.Object source)
         throws java.lang.Exception
This method should be used for executing group of calls to model as atomic action. Placing action in this method guarantee that model will not be affected via another threads in process of execution this action. Changes in model that represented by action will be executed synchronously. It means method will end only after all calls to model inside action would be executed. All model methods getXXX, setXX, addXX, etc. also atomic. If you need just get value or set new value in model you don't need to call this method. Each this action will be synchronized. You need to use this method when you need to perform many actions one depends from another. In this case value that you get in one action could be not valid for next action with model.

Type Parameters:
V - type for return value.
Parameters:
action - group of calls to model.
source - this is object that will be set as source for events that will be fired by model as result of this action. It could be used for distinguishing various consumers of model. Could be equall to null. If it equals to null then source of event will be set to Thread.currentThread(). One should not put "sync" method inside invoke() or in transaction that started with startTransaction(). Otherwise "sync" will no have any effect. OM consider starting transaction as starting mutation and in this case "sync" doesn't have sense.
Returns:
return value from action.
Throws:
java.lang.Exception - Exception exception that could be thrown by action

invoke

void invoke(java.lang.Runnable run)
This method execute command run inside read lock on OM obtained. You should never try mutate OM inside this command run. Otherwise you will get InvalidaStateException.

Parameters:
run - command for execution

findElement

BpelEntity findElement(int i)
Finds Bpel element on the specified position.

Parameters:
i - Position in NbDocument.
Returns:
Entity on the position if any.