63 lines
3.3 KiB
Java
63 lines
3.3 KiB
Java
|
|
/*
|
||
|
|
* Copyright (c) 2005,2008 Declarative Engineering LLC.
|
||
|
|
* All rights reserved. This program and the accompanying materials
|
||
|
|
* are made available under the terms of the Declarative Engineering LLC
|
||
|
|
* verson 1 which accompanies this distribution, and is available at
|
||
|
|
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
||
|
|
*/
|
||
|
|
package com.foundation.util;
|
||
|
|
|
||
|
|
import com.common.util.ICollection;
|
||
|
|
import com.foundation.attribute.IReflectCollectionSupport;
|
||
|
|
import com.foundation.attribute.IReflectableCollection;
|
||
|
|
import com.foundation.event.IEventEmitter;
|
||
|
|
import com.foundation.metadata.Event;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Defines a managed collection as a collection that is at least partially integrated into the containing object and is smart in that it can notify listeners when changes occur and can track the changes.
|
||
|
|
*/
|
||
|
|
public interface IManagedCollection extends ICollection, ITrackedCollection, IReflectableCollection, IReflectCollectionSupport, IEventEmitter, IInlineCollectionObservable {
|
||
|
|
/** Identifies a trusted change to the collection which does not need validation and should not be tracked. */
|
||
|
|
public static final byte CONTEXT_TRUSTED = com.foundation.attribute.AttributeSupport.CONTEXT_TRUSTED;
|
||
|
|
/** Identifies an untrusted change to the collection which requires change tracking. */
|
||
|
|
public static final byte CONTEXT_UNTRUSTED = com.foundation.attribute.AttributeSupport.CONTEXT_UNTRUSTED;
|
||
|
|
/**
|
||
|
|
* The event fired by the collection when it is altered. This can be listened to by other objects in the system to receive basic change notification.
|
||
|
|
* <p>
|
||
|
|
* <ul> Parameters:
|
||
|
|
* <li> <code>com.foundation.util.CollectionChangeEvent</code> A container for adds and removes.
|
||
|
|
* </ul>
|
||
|
|
*/
|
||
|
|
public static final Event EVENT = com.foundation.metadata.MetadataService.getSingleton().addEvent(IManagedCollection.class, "event");
|
||
|
|
/**
|
||
|
|
* The event fired by the collection when the size changes. This can be listened to by other objects in the system to receive size change notification.
|
||
|
|
* <p>
|
||
|
|
* <ul> Parameters:
|
||
|
|
* <li> None
|
||
|
|
* </ul>
|
||
|
|
*/
|
||
|
|
public static final Event SIZE = com.foundation.metadata.MetadataService.getSingleton().addEvent(IManagedCollection.class, "size");
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Defines a collection operation that may make multiple changes to the collection.
|
||
|
|
* The collection operation makes making changes more efficient since only one event is fired for a set of changes.
|
||
|
|
*/
|
||
|
|
public interface ICollectionOperation {
|
||
|
|
public void run(ManagedCollection collection);
|
||
|
|
}//ICollectionOperation//
|
||
|
|
/**
|
||
|
|
* Executes an operation on this collection such that events are condensed into one.
|
||
|
|
* @param operation the operation to be run.
|
||
|
|
*/
|
||
|
|
public void execute(ICollectionOperation operation);
|
||
|
|
/**
|
||
|
|
* Gets the extended error information regarding the last operation. This may be set by the application from within the collection's manager and then retrieved by the application after the operation fails.
|
||
|
|
* @return The application defined error data for the current or last operation performed.
|
||
|
|
*/
|
||
|
|
public Object getErrorInfo();
|
||
|
|
/**
|
||
|
|
* Sets the extended error information regarding the last operation. This may be set by the application from within the collection's manager and then retrieved by the application after the operation fails.
|
||
|
|
* @param errorInfo The application defined error data for the current or last operation performed.
|
||
|
|
*/
|
||
|
|
public void setErrorInfo(Object errorInfo);
|
||
|
|
}//IManagedCollection//
|