Package com.iizix.prop
Class PropMgr
java.lang.Object
com.iizix.prop.PropMgr
The property manager handles creation of generic properties and contains routines to serialize them to or from a transaction. The 
NameManager that can be retrieved from this class is used to map property names to integer values, i.e. indexes.Each client session (just one for the client) and several for the server must instanciate this class once and is used throughout the entire session.
- Author:
- Christopher Mindus
- Field SummaryFields
- Method SummaryModifier and TypeMethodDescription- booleanAdds a new listeners for completed incoming remote read transactions.- void- appendPropMgrData- (SendTransaction trans) Appends data from the property manager to a transaction.- booleanChecks if append property manager data is required.- createClientRootContainer- (IModuleProjectPropProvider modulePropProvider) Creates the client root container.- createRootContainer- (ReadTransaction trans, IModuleProjectPropProvider modulePropProvider) Creates the root container on the client side at the reception of the TRANS_CREATE transaction, initiates it from the Transaction and returns it.- voidEnabled binary frame compression for JavaScript clients supporting it.Gets the Client Environment.Gets the Environment property.- getOwner()Gets the owner Object of this Property Manager instance.Returns the information provider.Gets the root container.- getSendTransaction- (ITransactionCreator transCreator) Gets a transaction for sending.- int- getType()Get the Property Manager type.- booleanReturns if this has a JavaScript client or not.- booleanGets a Remote Event transaction from queued remote events.- boolean- isClient()Checks if this is a client or not.- boolean- isServer()Checks if this is a server or not.- voidProcess the TRANS_REMOTE_EVENT transaction.- void- processUpdateTrans- (PropCnr root, ReadTransaction trans) Processes the TRANS_UPDATE transaction on a root property container.- void- queueEvent- (GEvent event) Queues a property event during update of the property tree from the remote party until the entire tree has been updated.- void- queueRemoteEvent- (RemoteEvent event) Queues a property event during update of the property tree from the remote party until the entire tree has been updated.- void- readPropMgrData- (ReadTransaction trans) Reads property manager data from a transaction.- booleanRemoves an existing listener for completed incoming remote read transactions.- void- setOwner- (IPropMgrOwner owner) Sets the owner Object, can only be done once.- void- setProvider- (IPropMgrInfoProvider provider) Sets the information provider for the Property Manager.- voidTraces a line of data.- booleanChecks if Binary Frame Compression should be used.
- Field Details- CLIENTpublic static final int CLIENTThe application type: CLIENT = 0.- See Also:
 
- SERVERpublic static final int SERVERThe application type: SERVER = 1.- See Also:
 
- EDITORpublic static final int EDITORThe application type: EDITOR = 2.- See Also:
 
 
- Method Details- addRemoteTransactionCompletedListenerAdds a new listeners for completed incoming remote read transactions. The listeners added are called in the order they were added once a ReadTransaction from a remote party has completed its update.- The listener is typically used to process post-updates of multiple client property updates, rather than triggering on a single property update. - Calling this method multiple times with the same listener will have no effect (but to return false). - Parameters:
- listener- The listener to add.
- Returns:
- true if the listener was added, false otherwise.
- Throws:
- NullPointerException- If the listener is- null.
 
- removeRemoteTransactionCompletedListenerpublic boolean removeRemoteTransactionCompletedListener- (IRemoteTransactionCompletedListener listener) Removes an existing listener for completed incoming remote read transactions.- Calling this method multiple times with the same listener will have no effect (but to return false). - Parameters:
- listener- The listener to remove.
- Returns:
- true if listener is successfully removed, false otherwise.
 
- setOwnerSets the owner Object, can only be done once.- Parameters:
- owner- The owner object.
- Throws:
- IllegalStateException- If called more than once.
- NullPointerException- If owner is null.
 
- getOwnerGets the owner Object of this Property Manager instance. For e.g. the Designer, it may be the Panel Editor instance.
- processUpdateTransProcesses the TRANS_UPDATE transaction on a root property container.- Parameters:
- root- The root property container.
- trans- The create transaction.
 
- processRemoveEventProcess the TRANS_REMOTE_EVENT transaction.
- queueRemoteEventQueues a property event during update of the property tree from the remote party until the entire tree has been updated. Once this is done, the method- dispatchEvents()is called.
- hasRemoteEventTranspublic boolean hasRemoteEventTrans()Gets a Remote Event transaction from queued remote events.- Returns:
- The transaction to send, or null if no more queued events are present.
 
- queueEventQueues a property event during update of the property tree from the remote party until the entire tree has been updated. Once this is done, the method- dispatchEvents()is called.- Parameters:
- event- Event to queue.
 
- getSendTransactionGets a transaction for sending. This call is done when a transaction trigger is fired that potentially creates an update to the root. The root property updates the transaction as needed, then all outstanding remote events are appended. Last, the atom table is prepended to the transaction. This method returns null when no update is required.- Parameters:
- transCreator- The transaction creator instance.
- Returns:
- Transaction to send, or null for none.
 
- traceTraces a line of data.- Parameters:
- originator- the originating property or null for none.
- text- the text to write to the trace output.
 
- hasJavaScriptClientpublic boolean hasJavaScriptClient()Returns if this has a JavaScript client or not.- Returns:
- true if it's a JavaScript client, false otherwise.
 
- isClientpublic boolean isClient()Checks if this is a client or not.- Returns:
- true if it's the client, false for server or editor.
 
- isServerpublic boolean isServer()Checks if this is a server or not.- Returns:
- true if it's the server, false for client or editor.
 
- getTypepublic int getType()Get the Property Manager type.- Returns:
- EDITOR, SERVER or CLIENT.
 
- useWebSocketBinaryFrameCompressionpublic boolean useWebSocketBinaryFrameCompression()Checks if Binary Frame Compression should be used.- Returns:
- A Client connection in JavaScript returns false by default, unless it supports compression, others return true.
 
- enableWebSocketBinaryFrameCompressionpublic void enableWebSocketBinaryFrameCompression()Enabled binary frame compression for JavaScript clients supporting it.
- areNewAtomsPresentpublic boolean areNewAtomsPresent()Checks if append property manager data is required.
- appendPropMgrDataAppends data from the property manager to a transaction.- Parameters:
- trans- the transaction to the data append to.
 
- readPropMgrDataReads property manager data from a transaction.- Parameters:
- trans- the transaction to read property manager data from.
 
- createRootContainerpublic ClientProps createRootContainer- (ReadTransaction trans, IModuleProjectPropProvider modulePropProvider) Creates the root container on the client side at the reception of the TRANS_CREATE transaction, initiates it from the Transaction and returns it.- Parameters:
- trans- The create transaction.
- Returns:
- The root property container.
 
- createClientRootContainerCreates the client root container.
- getRootContainerGets the root container.- Returns:
- The last instance created by createRootContainer().
 
- getEnvironmentGets the Environment property.- Returns:
- The Environment or null if communication is not established.
 
- getClientEnvGets the Client Environment.- Returns:
- The Client Environment or null if communication is not established.
 
- setProviderSets the information provider for the Property Manager.- Parameters:
- provider- The provider, non-null.
- Throws:
- NullPointerException- If- provideris null.
- IllegalStateException- If the provider already is initialized.
 
- getProviderReturns the information provider.- Returns:
- The information provider, null for none.