Package org.eclipse.ecf.core.sharedobject.model

# Class SharedModel

java.lang.Object
org.eclipse.ecf.core.sharedobject.BaseSharedObject
org.eclipse.ecf.core.sharedobject.OptimisticSharedObject
org.eclipse.ecf.core.sharedobject.model.SharedModel

All Implemented Interfaces:
  `org.eclipse.core.runtime.IAdaptable`, `IIdentifiable`, `ISharedObject`

public class SharedModel extends OptimisticSharedObject

Since:
  2.4

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`class`
`SharedModel.Property`

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final String`
`SEND_PROPERTY_TO_MSG`

### Fields inherited from class org.eclipse.ecf.core.sharedobject.BaseSharedObject

`DESTROYREMOTE_CODE, DESTROYSELFLOCAL_CODE`

## Constructor Summary

Constructors
Constructor
Description
`SharedModel()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`addListener(ISharedModelListener listener)`
`protected SharedModel.Property`
`addProperty(String name)`
`protected SharedModel.Property`
`addProperty(String name, Object value)`
`protected SharedModel.Property`
`addProperty(SharedModel.Property property)`
`protected Collection<SharedModel.Property>`
`copyProperties()`
`void`
`dispose(ID containerID)`
Method called by the ISharedObjectContainer upon ISharedObject destruction.
`protected void`
`fireListeners(ISharedModelEvent event)`
`protected Map<String,?>`
`getMapFromProperties()`
`protected SharedModel.Property`
`getOrAddProperty(String propertyName)`
`protected SharedModel.Property`
`getProperty(String propertyName)`
`protected void`
`handleListenerException(ISharedModelListener l, Throwable exception)`
`protected boolean`
`handlePropertyTo(ID fromID, String msg, SharedModel.Property property)`
`protected boolean`
`handleSharedObjectMsg(ID fromID, SharedObjectMsg msg)`
`protected void`
`removeAllProperties()`
`boolean`
`removeListener(ISharedModelListener listener)`
`protected SharedModel.Property`
`removeProperty(String propertyName)`
`protected final void`
`sendPropertyTo(ID target, String msg, SharedModel.Property property)`
`protected final void`
`sendPropertyTo(ID target, SharedModel.Property property)`
`protected SharedModel.Property`
`setOrAddProperty(String propertyName, Object value)`
`protected void`
`setPropertiesFromMap(Map<String,?> map)`

### Methods inherited from class org.eclipse.ecf.core.sharedobject.OptimisticSharedObject

`initialize`

### Methods inherited from class org.eclipse.ecf.core.sharedobject.BaseSharedObject

`addEventProcessor, clearEventProcessors, creationCompleted, destroyRemote, destroySelf, destroySelfLocal, fireEventProcessors, getAdapter, getConfig, getConnectedID, getContext, getGroupMemberIDs, getHomeContainerID, getID, getLocalContainerID, getProperties, getReplicaDescription, getReplicaDescriptions, getSharedObjectMsgFromEvent, handleEvent, handleEvents, handleSharedObjectCreateResponseEvent, handleSharedObjectMsg, handleSharedObjectMsgEvent, handleUnhandledEvent, init, isConnected, isPrimary, log, log, removeEventProcessor, replicateToRemoteContainers, sendSharedObjectMsgTo, sendSharedObjectMsgToPrimary, sendSharedObjectMsgToSelf, trace, traceCatching, traceEntering, traceEntering, traceEntering, traceExiting, traceExiting`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### SEND_PROPERTY_TO_MSG

protected final String SEND_PROPERTY_TO_MSG

See Also:
  - Constant Field Values

## Constructor Details

### SharedModel

public SharedModel()

## Method Details

### addListener

public boolean addListener(ISharedModelListener listener)

### removeListener

public boolean removeListener(ISharedModelListener listener)

### handleListenerException

protected void handleListenerException(ISharedModelListener l, Throwable exception)

### fireListeners

protected void fireListeners(ISharedModelEvent event)

### dispose

public void dispose(ID containerID)
Description copied from interface: `ISharedObject`
Method called by the ISharedObjectContainer upon ISharedObject destruction. Once this method is called, no more Events will be passed to a ISharedObject until the init method is called again.

Specified by:
  `dispose` in interface `ISharedObject`
Overrides:
  `dispose` in class `BaseSharedObject`
Parameters:
  `containerID` - the ID of the container that is disposing this ISharedObject

### copyProperties

protected Collection<SharedModel.Property> copyProperties()

### addProperty

protected SharedModel.Property addProperty(String name)

### addProperty

protected SharedModel.Property addProperty(String name, Object value)

### addProperty

protected SharedModel.Property addProperty(SharedModel.Property property)

### removeProperty

protected SharedModel.Property removeProperty(String propertyName)

### getProperty

protected SharedModel.Property getProperty(String propertyName)

### getOrAddProperty

protected SharedModel.Property getOrAddProperty(String propertyName)

### setOrAddProperty

protected SharedModel.Property setOrAddProperty(String propertyName, Object value)

### removeAllProperties

protected void removeAllProperties()

### getMapFromProperties

protected Map<String,?> getMapFromProperties()

### setPropertiesFromMap

protected void setPropertiesFromMap(Map<String,?> map)

### sendPropertyTo

protected final void sendPropertyTo(ID target, String msg, SharedModel.Property property) throws IOException

Throws:
  `IOException`

### sendPropertyTo

protected final void sendPropertyTo(ID target, SharedModel.Property property) throws IOException

Throws:
  `IOException`

### handleSharedObjectMsg

protected boolean handleSharedObjectMsg(ID fromID, SharedObjectMsg msg)

Overrides:
  `handleSharedObjectMsg` in class `BaseSharedObject`

### handlePropertyTo

protected boolean handlePropertyTo(ID fromID, String msg, SharedModel.Property property)