/** * create a new data item structure. * <p> * Note that the item is initially connected to the item manager provided. * You must call {@link #unregister()} when you want to clear the * subscription with the item on the server. * * @param itemId * the id of the item to register * @param itemManager * the item manager to which the item will register */ public DataItem ( final String itemId, final ItemManager itemManager ) { this ( itemId ); if ( itemManager != null ) { register ( itemManager ); } }
/** * create a new data item structure. * <p> * Note that the item is initially connected to the item manager provided. * You must call {@link #unregister()} when you want to clear the * subscription with the item on the server. * * @param itemId * the id of the item to register * @param itemManager * the item manager to which the item will register */ public DataItem ( final String itemId, final ItemManager itemManager ) { this ( itemId ); if ( itemManager != null ) { register ( itemManager ); } }
private void bind () { if ( this.service != null && this.itemId != null ) { final ItemManager im = this.service.getItemManager (); this.dataItem = new DataItem ( this.itemId ); this.dataItem.addObserver ( this.observer = createObserver () ); this.dataItem.register ( im ); } }
private void bind () { if ( this.service != null && this.itemId != null ) { final ItemManager im = this.service.getItemManager (); this.dataItem = new DataItem ( this.itemId ); this.dataItem.addObserver ( this.observer = createObserver () ); this.dataItem.register ( im ); } }
@Override protected synchronized void bindConnection ( final ConnectionService connectionService ) { super.bindConnection ( connectionService ); if ( connectionService != null ) { this.dataItem = new DataItem ( this.item.getId () ); if ( this.listener != null ) { this.dataItem.addObserver ( this.observer ); this.dataItem.register ( connectionService.getItemManager () ); } } }
protected synchronized void setConnection ( final ConnectionService connectionService ) { disconnect (); if ( connectionService instanceof org.eclipse.scada.da.connection.provider.ConnectionService ) { this.connectionService = (org.eclipse.scada.da.connection.provider.ConnectionService)connectionService; this.dataItem = new DataItem ( this.item.getId () ); this.dataItem.addObserver ( this ); this.dataItem.register ( this.connectionService.getItemManager () ); } // at the end we are disconnected ... notify as last operation if ( this.connectionService == null ) { notifyChange ( DataItemValue.DISCONNECTED ); } }