/** * Mark all the listeners past this one as temporary. */ public void markTempListeners(FileListener listenerLast) { while (listenerLast != null) { listenerLast = (FileListener)listenerLast.getNextListener(); if (listenerLast != null) listenerLast.setMasterSlaveFlag(listenerLast.getMasterSlaveFlag() | (FileListener.INITED_IN_SLAVE * 2)); } } /**
/** * Mark all the listeners past this one as temporary. */ public void markTempListeners(FileListener listenerLast) { while (listenerLast != null) { listenerLast = (FileListener)listenerLast.getNextListener(); if (listenerLast != null) listenerLast.setMasterSlaveFlag(listenerLast.getMasterSlaveFlag() | (FileListener.INITED_IN_SLAVE * 2)); } } /**
/** * Is this listener enabled? * Note: This logic checks for 'client-only behaviors' trying to run in * an environment that doesn't support 'servers' (client-only environments). * @return true if this should be used. */ public boolean isEnabled() { if ((this.getMasterSlaveFlag() & FileListener.RUN_IN_SLAVE) == 0) // Is NOT enabled in a SERVER only environment if (this.getOwner() != null) if ((this.getOwner().getMasterSlave() & RecordOwner.MASTER) == 0) // Is not a client environment return false; // Don't run this listener in a server-only environment if ((this.getMasterSlaveFlag() & FileListener.RUN_IN_MASTER) == 0) // Is NOT enabled in a CLIENT only environment if (this.getOwner() != null) if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) == 0) // Is not a server environment return false; // Don't run this listener in a client-only environment return super.isEnabled(); } /**
/** * Is this listener enabled? * Note: This logic checks for 'client-only behaviors' trying to run in * an environment that doesn't support 'servers' (client-only environments). * @return true if this should be used. */ public boolean isEnabled() { if ((this.getMasterSlaveFlag() & FileListener.RUN_IN_SLAVE) == 0) // Is NOT enabled in a SERVER only environment if (this.getOwner() != null) if ((this.getOwner().getMasterSlave() & RecordOwner.MASTER) == 0) // Is not a client environment return false; // Don't run this listener in a server-only environment if ((this.getMasterSlaveFlag() & FileListener.RUN_IN_MASTER) == 0) // Is NOT enabled in a CLIENT only environment if (this.getOwner() != null) if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) == 0) // Is not a server environment return false; // Don't run this listener in a client-only environment return super.isEnabled(); } /**
/** * Is this listener enabled? * Note: This logic checks for 'client-only behaviors' trying to run in * an environment that doesn't support 'servers' (client-only environments). * @return true if this should be used. */ public boolean isEnabled() { if ((this.getMasterSlaveFlag() & FileListener.RUN_IN_SLAVE) == 0) // Is NOT enabled in a SERVER only environment if (this.getOwner() != null) if ((this.getOwner().getMasterSlave() & RecordOwner.MASTER) == 0) // Is not a client environment return false; // Don't run this listener in a server-only environment if ((this.getMasterSlaveFlag() & FileListener.RUN_IN_MASTER) == 0) // Is NOT enabled in a CLIENT only environment if (this.getOwner() != null) if ((this.getOwner().getMasterSlave() & RecordOwner.SLAVE) == 0) // Is not a server environment return false; // Don't run this listener in a client-only environment return super.isEnabled(); } /**
/** * Remove any of the temporary file filters added on the last time through. */ public FileListener removeTempListeners() { FileListener listenerLast = null; Record recProduct = this.getMainRecord(); FileListener listenerNext = recProduct.getListener(); while (listenerNext != null) { if ((listenerNext.getMasterSlaveFlag() & (FileListener.INITED_IN_SLAVE * 2)) != 0) { recProduct.removeListener(listenerNext, true); listenerNext = listenerLast; if (listenerNext == null) listenerNext = recProduct.getListener(); } else { listenerLast = listenerNext; // Last one that wasn't removed listenerNext = (FileListener)listenerNext.getNextListener(); } } return listenerLast; } /**
/** * Remove any of the temporary file filters added on the last time through. */ public FileListener removeTempListeners() { FileListener listenerLast = null; Record recProduct = this.getMainRecord(); FileListener listenerNext = recProduct.getListener(); while (listenerNext != null) { if ((listenerNext.getMasterSlaveFlag() & (FileListener.INITED_IN_SLAVE * 2)) != 0) { recProduct.removeListener(listenerNext, true); listenerNext = listenerLast; if (listenerNext == null) listenerNext = recProduct.getListener(); } else { listenerLast = listenerNext; // Last one that wasn't removed listenerNext = (FileListener)listenerNext.getNextListener(); } } return listenerLast; } /**
while (listener != null) if ((listener.getMasterSlaveFlag() & FileListener.LINKED_TO_SLAVE) != 0) listener.setMasterSlaveFlag(listener.getMasterSlaveFlag() & ~FileListener.INITED_IN_SLAVE); // Clear inited flag listener = (FileListener)listener.getNextListener(); listener.setMasterSlaveFlag(listener.getMasterSlaveFlag() | FileListener.INITED_IN_SLAVE | FileListener.LINKED_TO_SLAVE | FileListener.RUN_IN_SLAVE); listener.setMasterSlaveFlag(listener.getMasterSlaveFlag() | FileListener.INITED_IN_SLAVE | FileListener.LINKED_TO_SLAVE | FileListener.RUN_IN_SLAVE); while (listener != null) if ((listener.getMasterSlaveFlag() & FileListener.LINKED_TO_SLAVE) != 0) if ((listener.getMasterSlaveFlag() & FileListener.INITED_IN_SLAVE) == 0) break; // Use this listener (Linked, but not inited) listener = (FileListener)listener.getListener(strBehaviorName); listener.setMasterSlaveFlag(listener.getMasterSlaveFlag() | FileListener.INITED_IN_SLAVE | FileListener.LINKED_TO_SLAVE); try { strBehaviorName = daIn.readUTF(); if ((behaviorToRemove.getMasterSlaveFlag() & FileListener.LINKED_TO_SLAVE) != 0) if ((behaviorToRemove.getMasterSlaveFlag() & FileListener.INITED_IN_SLAVE) == 0) this.getMainRecord().removeListener(behaviorToRemove, true);