Author: peter_firmstone Date: Tue Jan 5 11:06:17 2016 New Revision: 1723044
URL: http://svn.apache.org/viewvc?rev=1723044&view=rev Log: Prep for release: Update javadoc for some new implementation classes. Consolidate org.apache.river.impl.thread package into org.apache.river.thread for release (minor tidy up). Postpone StreamServiceRegistrar and related until a later release to avoid confusion (no implementation exists). Added: river/jtsk/trunk/src/org/apache/river/thread/DependencyLinker.java - copied, changed from r1721711, river/jtsk/trunk/src/org/apache/river/impl/thread/DependencyLinker.java river/jtsk/trunk/src/org/apache/river/thread/ExtensibleExecutorService.java - copied, changed from r1721711, river/jtsk/trunk/src/org/apache/river/impl/thread/ExtensibleExecutorService.java river/jtsk/trunk/src/org/apache/river/thread/FutureObserver.java - copied, changed from r1721711, river/jtsk/trunk/src/org/apache/river/api/util/FutureObserver.java river/jtsk/trunk/src/org/apache/river/thread/NamedThreadFactory.java - copied, changed from r1721711, river/jtsk/trunk/src/org/apache/river/impl/thread/NamedThreadFactory.java river/jtsk/trunk/src/org/apache/river/thread/ObservableFutureTask.java - copied, changed from r1721711, river/jtsk/trunk/src/org/apache/river/impl/thread/ObservableFutureTask.java river/jtsk/trunk/src/org/apache/river/thread/SynchronousExecutors.java - copied, changed from r1721711, river/jtsk/trunk/src/org/apache/river/impl/thread/SynchronousExecutors.java river/jtsk/trunk/test/src/org/apache/river/thread/ river/jtsk/trunk/test/src/org/apache/river/thread/SynchronousExecutorsTest.java - copied, changed from r1721711, river/jtsk/trunk/test/src/org/apache/river/impl/thread/SynchronousExecutorsTest.java Removed: river/jtsk/trunk/src/org/apache/river/api/lookup/ServiceResultStreamFilter.java river/jtsk/trunk/src/org/apache/river/api/lookup/StreamServiceRegistrar.java river/jtsk/trunk/src/org/apache/river/api/lookup/package.html river/jtsk/trunk/src/org/apache/river/api/util/Facade.java river/jtsk/trunk/src/org/apache/river/api/util/FutureObserver.java river/jtsk/trunk/src/org/apache/river/api/util/ResultStream.java river/jtsk/trunk/test/src/org/apache/river/impl/thread/SynchronousExecutorsTest.java Modified: river/jtsk/trunk/src/net/jini/discovery/AbstractLookupDiscovery.java river/jtsk/trunk/src/net/jini/discovery/AbstractLookupLocatorDiscovery.java river/jtsk/trunk/src/net/jini/discovery/LookupLocatorDiscovery.java river/jtsk/trunk/src/net/jini/export/Exporter.java river/jtsk/trunk/src/net/jini/lease/LeaseRenewalManager.java river/jtsk/trunk/src/net/jini/loader/LoadClass.java river/jtsk/trunk/src/net/jini/lookup/JoinManager.java river/jtsk/trunk/src/net/jini/lookup/ServiceDiscoveryManager.java river/jtsk/trunk/src/org/apache/river/api/security/CombinerSecurityManager.java river/jtsk/trunk/src/org/apache/river/api/security/DelegatePermission.java river/jtsk/trunk/src/org/apache/river/api/security/DelegateSecurityManager.java river/jtsk/trunk/src/org/apache/river/api/security/RemotePolicy.java river/jtsk/trunk/src/org/apache/river/api/security/RemotePolicyProvider.java river/jtsk/trunk/src/org/apache/river/api/util/Startable.java river/jtsk/trunk/src/org/apache/river/fiddler/FiddlerInit.java river/jtsk/trunk/src/org/apache/river/mahalo/TxnManagerImpl.java river/jtsk/trunk/src/org/apache/river/mahalo/TxnManagerImplInitializer.java river/jtsk/trunk/src/org/apache/river/mercury/MailboxImpl.java river/jtsk/trunk/src/org/apache/river/norm/event/EventTypeGenerator.java river/jtsk/trunk/src/org/apache/river/outrigger/Notifier.java river/jtsk/trunk/src/org/apache/river/outrigger/TxnMonitor.java river/jtsk/trunk/src/org/apache/river/reggie/RegistrarImpl.java river/jtsk/trunk/src/org/apache/river/thread/RetryTask.java Modified: river/jtsk/trunk/src/net/jini/discovery/AbstractLookupDiscovery.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/net/jini/discovery/AbstractLookupDiscovery.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/net/jini/discovery/AbstractLookupDiscovery.java (original) +++ river/jtsk/trunk/src/net/jini/discovery/AbstractLookupDiscovery.java Tue Jan 5 11:06:17 2016 @@ -90,7 +90,7 @@ import net.jini.security.BasicProxyPrepa import net.jini.security.ProxyPreparer; import net.jini.security.Security; import net.jini.security.SecurityContext; -import org.apache.river.impl.thread.NamedThreadFactory; +import org.apache.river.thread.NamedThreadFactory; /** Modified: river/jtsk/trunk/src/net/jini/discovery/AbstractLookupLocatorDiscovery.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/net/jini/discovery/AbstractLookupLocatorDiscovery.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/net/jini/discovery/AbstractLookupLocatorDiscovery.java (original) +++ river/jtsk/trunk/src/net/jini/discovery/AbstractLookupLocatorDiscovery.java Tue Jan 5 11:06:17 2016 @@ -64,9 +64,9 @@ import net.jini.core.discovery.LookupLoc import net.jini.core.lookup.ServiceRegistrar; import net.jini.security.BasicProxyPreparer; import net.jini.security.ProxyPreparer; -import org.apache.river.impl.thread.ExtensibleExecutorService; -import org.apache.river.impl.thread.ExtensibleExecutorService.RunnableFutureFactory; -import org.apache.river.impl.thread.NamedThreadFactory; +import org.apache.river.thread.ExtensibleExecutorService; +import org.apache.river.thread.ExtensibleExecutorService.RunnableFutureFactory; +import org.apache.river.thread.NamedThreadFactory; /** * This package private superclass of LookupLocatorDiscovery exists for Modified: river/jtsk/trunk/src/net/jini/discovery/LookupLocatorDiscovery.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/net/jini/discovery/LookupLocatorDiscovery.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/net/jini/discovery/LookupLocatorDiscovery.java (original) +++ river/jtsk/trunk/src/net/jini/discovery/LookupLocatorDiscovery.java Tue Jan 5 11:06:17 2016 @@ -21,7 +21,7 @@ import java.util.logging.Logger; import net.jini.config.Configuration; import net.jini.config.ConfigurationException; import net.jini.core.discovery.LookupLocator; -import org.apache.river.impl.thread.NamedThreadFactory; +import org.apache.river.thread.NamedThreadFactory; /** * This class encapsulates the functionality required of an entity that Modified: river/jtsk/trunk/src/net/jini/export/Exporter.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/net/jini/export/Exporter.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/net/jini/export/Exporter.java (original) +++ river/jtsk/trunk/src/net/jini/export/Exporter.java Tue Jan 5 11:06:17 2016 @@ -50,6 +50,12 @@ public interface Exporter { * <code>java.rmi.Remote</code> and whose methods each declare at least * one exception whose type is <code>java.rmi.RemoteException</code> * or one of its superclasses. + * + * <p>This method should not be called from within an object constructor, + * otherwise the object reference will escape during construction, leaving + * the remote object implementation in an undefined state. + * + * @see org.apache.river.api.util.Startable * * @param impl a remote object to export * @return a proxy for the remote object Modified: river/jtsk/trunk/src/net/jini/lease/LeaseRenewalManager.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/net/jini/lease/LeaseRenewalManager.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/net/jini/lease/LeaseRenewalManager.java (original) +++ river/jtsk/trunk/src/net/jini/lease/LeaseRenewalManager.java Tue Jan 5 11:06:17 2016 @@ -47,7 +47,7 @@ import net.jini.core.lease.LeaseExceptio import net.jini.core.lease.LeaseMap; import net.jini.core.lease.LeaseMapException; import net.jini.core.lease.UnknownLeaseException; -import org.apache.river.impl.thread.NamedThreadFactory; +import org.apache.river.thread.NamedThreadFactory; /** * Provides for the systematic renewal and overall management of a set Modified: river/jtsk/trunk/src/net/jini/loader/LoadClass.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/net/jini/loader/LoadClass.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/net/jini/loader/LoadClass.java (original) +++ river/jtsk/trunk/src/net/jini/loader/LoadClass.java Tue Jan 5 11:06:17 2016 @@ -32,7 +32,7 @@ import java.util.concurrent.FutureTask; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import org.apache.river.impl.thread.NamedThreadFactory; +import org.apache.river.thread.NamedThreadFactory; /** * LoadClass delegates to @link {Class#forName(String, boolean, ClassLoader)}, Modified: river/jtsk/trunk/src/net/jini/lookup/JoinManager.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/net/jini/lookup/JoinManager.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/net/jini/lookup/JoinManager.java (original) +++ river/jtsk/trunk/src/net/jini/lookup/JoinManager.java Tue Jan 5 11:06:17 2016 @@ -63,11 +63,11 @@ import java.util.concurrent.ThreadPoolEx import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; -import org.apache.river.api.util.FutureObserver; -import org.apache.river.impl.thread.DependencyLinker; -import org.apache.river.impl.thread.ExtensibleExecutorService; -import org.apache.river.impl.thread.ExtensibleExecutorService.RunnableFutureFactory; -import org.apache.river.impl.thread.NamedThreadFactory; +import org.apache.river.thread.FutureObserver; +import org.apache.river.thread.DependencyLinker; +import org.apache.river.thread.ExtensibleExecutorService; +import org.apache.river.thread.ExtensibleExecutorService.RunnableFutureFactory; +import org.apache.river.thread.NamedThreadFactory; /** * A goal of any well-behaved service is to advertise the facilities and Modified: river/jtsk/trunk/src/net/jini/lookup/ServiceDiscoveryManager.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/net/jini/lookup/ServiceDiscoveryManager.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/net/jini/lookup/ServiceDiscoveryManager.java (original) +++ river/jtsk/trunk/src/net/jini/lookup/ServiceDiscoveryManager.java Tue Jan 5 11:06:17 2016 @@ -84,13 +84,13 @@ import net.jini.security.BasicProxyPrepa import net.jini.security.ProxyPreparer; import net.jini.security.TrustVerifier; import net.jini.security.proxytrust.ServerProxyTrust; -import org.apache.river.api.util.FutureObserver; -import org.apache.river.api.util.FutureObserver.ObservableFuture; -import org.apache.river.impl.thread.DependencyLinker; -import org.apache.river.impl.thread.ExtensibleExecutorService; -import org.apache.river.impl.thread.ExtensibleExecutorService.RunnableFutureFactory; -import org.apache.river.impl.thread.NamedThreadFactory; -import org.apache.river.impl.thread.ObservableFutureTask; +import org.apache.river.thread.FutureObserver; +import org.apache.river.thread.FutureObserver.ObservableFuture; +import org.apache.river.thread.DependencyLinker; +import org.apache.river.thread.ExtensibleExecutorService; +import org.apache.river.thread.ExtensibleExecutorService.RunnableFutureFactory; +import org.apache.river.thread.NamedThreadFactory; +import org.apache.river.thread.ObservableFutureTask; /** * The <code>ServiceDiscoveryManager</code> class is a helper utility class that Modified: river/jtsk/trunk/src/org/apache/river/api/security/CombinerSecurityManager.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/api/security/CombinerSecurityManager.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/api/security/CombinerSecurityManager.java (original) +++ river/jtsk/trunk/src/org/apache/river/api/security/CombinerSecurityManager.java Tue Jan 5 11:06:17 2016 @@ -50,7 +50,7 @@ import net.jini.security.SecurityContext import org.apache.river.concurrent.RC; import org.apache.river.concurrent.Ref; import org.apache.river.concurrent.Referrer; -import org.apache.river.impl.thread.NamedThreadFactory; +import org.apache.river.thread.NamedThreadFactory; import org.cliffc.high_scale_lib.NonBlockingHashMap; /** Modified: river/jtsk/trunk/src/org/apache/river/api/security/DelegatePermission.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/api/security/DelegatePermission.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/api/security/DelegatePermission.java (original) +++ river/jtsk/trunk/src/org/apache/river/api/security/DelegatePermission.java Tue Jan 5 11:06:17 2016 @@ -42,50 +42,130 @@ import java.util.ArrayList; import org.apache.river.api.security.DefaultPolicyScanner.PermissionEntry; /** + * Permissions such as SocketPermission or FilePermission guard a resource + * but allow that resource to escape the control of the SecurityManager + * and Policy provider, this prevents them from being revoked. DelegatePermission + * supports Li Gong's method guard pattern, by allowing developers to implement + * a method guard delegate object, that checks for the DelegatePermission on + * every invocation, without allowing a reference to the resource to permanently + * escape the control of the SecurityManager or Policy provider. + * <p> * A DelegatePermission represents any other Permission, called a candidate * Permission. A user granted a DelegatePermission does not have the privilege * of the candidate Permission, although a user with a candidate Permission * has the privilege of the DelegatePermission that represents the candidate, * while the @ref DelegateSecurityManager is in force. - * - * A DelegatePermission requires a security delegate to be of any - * use or value. A security delegates ProtectionDomain is granted the - * candidate permission, the security delegate allows any user granted the - * DelegatePermission to utilise the functions that the candidate Permission - * guards, when the user no longer has the DelegatePermission, the security + * <p> + * A DelegatePermission requires a method guard delegate to encapsulate a privileged + * resource. The developer is responsible for developing the method guard wrapper, an + * example for SocketFactory can be found on Apache River's svn. + * <p> + * A method guard delegates ProtectionDomain is granted the + * candidate permission, the security delegate allows any user granted a + * DelegatePermission to utilise the functions that its candidate Permission + * guards, when the user no longer has the DelegatePermission, the method guard * delegate no longer allows the user to access the functions guarded by the * candidate permission. A security delegate has the responsibility to * prevent security sensitive objects guarded by the candidate permission from * escaping. In order to do so, a security delegate utilises Li Gong's - * method guard pattern. - * + * proposed method guard pattern. + * <p> * Security Delegates enable sensitive objects to be used by code that isn't * fully trusted you may want to monitor, such as a * file write that is limited by the number of bytes written, or a Permission * to write a file, that we might decide to retract or revoke if a user * does something we don't like, such as exceed a pre set limit or behave * in a manner we would like to avoid, such as hogging network bandwidth. - * + * <p> * If the SecurityManager installed doesn't implement DelegateSecurityManager, - * the DelegatePermission Guard's will be disabled. This allows delegate's + * DelegatePermission's will be disabled. This allows delegate's * to be included in code, the decision to utilise delegate functionality may * delayed until runtime or deployment. - * + * <p> * The DelegatePermissionCollection returned by newPermissionCollection() is not * synchronized, this decision was made because PermissionCollection's are * usually accessed from within a heterogenous PermissionCollection like * Permissions that synchronizes anyway. The decision made for the * PermissionCollection contract to be synchronized has been broken deliberately - * in this case, existing PermissionCollection implementatations don't cleanly + * in this case, existing PermissionCollection implementations don't cleanly * protect their internal state with synchronization, since the Enumeration * returned by elements() will throw a ConcurrentModificationException if in a * loop when Permission's are being added to a PermissionCollection. In this * case external synchronization must be used. - * - * PermissionCollection's are used mostly read only. - * + * <p> * Serialization has been implemented so the implementation is not * tied to the serialized form, instead serialization proxy's are used. + * <p> + * A candidate permission is referred to as a target in the following + * explanation of DelegatePermission policy file syntax. + * <p> + * The syntax of the target name approximates that used for specifying + * permissions in the default security policy file; it is listed below using + * the same grammar notation employed by <i>The Java(TM) Language + * Specification</i>: + * <pre> + * <i>Target</i>: + * <i>DelimiterDeclaration</i><sub>opt</sub> <i>Permissions</i> ;<sub>opt</sub> + * + * <i>DelimiterDeclaration</i>: + * delim = <i>DelimiterCharacter</i> + * + * <i>Permissions</i>: + * <i>Permission</i> + * <i>Permissions</i> ; <i>Permission</i> + * + * <i>Permission</i>: + * <i>PermissionClassName</i> + * <i>PermissionClassName Name</i> + * <i>PermissionClassName Name</i> , <i>Actions</i> + * + * <i>PermissionClassName</i>: + * <i>ClassName</i> + * + * <i>Name</i>: + * <i>DelimitedString</i> + * + * <i>Actions</i>: + * <i>DelimitedString</i> + * </pre> + * The production for <i>ClassName</i> is the same as that used in <i>The + * Java Language Specification</i>. <i>DelimiterCharacter</i> can be any + * unquoted non-whitespace character other than ';' (single and + * double-quote characters themselves are allowed). If + * <i>DelimiterCharacter</i> is not specified, then the double-quote + * character is the default delimiter. <i>DelimitedString</i> is the same + * as the <i>StringLiteral</i> production in <i>The Java Language + * Specification</i>, except that it is delimited by the + * <i>DelimiterDeclaration</i>-specified (or default) delimiter character + * instead of the double-quote character exclusively. + * <p> + * Note that if the double-quote character is used as the delimiter and the + * name or actions strings of specified permissions themselves contain nested + * double-quote characters, then those characters must be escaped (or in some + * cases doubly-escaped) appropriately. For example, the following policy file + * entry would yield a <code>GrantPermission</code> containing a + * <code>FooPermission</code> in which the target name would include the word + * "quoted" surrounded by double-quote characters: + * <pre> + * permission org.apache.river.api.security.DelegatePermission + * "FooPermission \"a \\\"quoted\\\" string\""; + * </pre> + * For comparison, the following policy file entry which uses a custom + * delimiter would yield an equivalent <code>GrantPermission</code>: + * <pre> + * permission org.apache.river.api.security.DelegatePermission + * "delim=| FooPermission |a \"quoted\" string|"; + * </pre> + * Some additional example policy file permissions: + * <pre> + * // allow granting of permission to listen for and accept connections + * permission org.apache.river.api.security.DelegatePermission + * "java.net.SocketPermission \"localhost:1024-\", \"accept,listen\""; + * + * // allow granting of permissions to read files under /foo, /bar directories + * permission org.apache.river.api.security.DelegatePermission + * "delim=' java.io.FilePermission '/foo/-', 'read'; java.io.FilePermission '/bar/-', 'read'"; + * </pre> * * @author Peter Firmstone * @since 3.0.0 Modified: river/jtsk/trunk/src/org/apache/river/api/security/DelegateSecurityManager.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/api/security/DelegateSecurityManager.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/api/security/DelegateSecurityManager.java (original) +++ river/jtsk/trunk/src/org/apache/river/api/security/DelegateSecurityManager.java Tue Jan 5 11:06:17 2016 @@ -25,15 +25,15 @@ import java.security.ProtectionDomain; * The DelegateSecurityManager is designed to enable the use of * Delegate decorators to encapsulate security sensitive objects using * Li Gong's method guard pattern. - * + * <p> * In this manner we can prevent references to security sensitive object's from * escaping. - * + * <p> * See "Inside Java 2 Platform Security" 2nd Edition, ISBN:0-201-78791-1, page 176. - * + * <p> * Delegate implementations are available separately from the Apache River * release. - * + * <p> * Delegates can be enabled at runtime by using the DelegateSecurityManager, * but only for code that utilises delegates. * Modified: river/jtsk/trunk/src/org/apache/river/api/security/RemotePolicy.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/api/security/RemotePolicy.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/api/security/RemotePolicy.java (original) +++ river/jtsk/trunk/src/org/apache/river/api/security/RemotePolicy.java Tue Jan 5 11:06:17 2016 @@ -28,17 +28,20 @@ import org.apache.river.api.common.Beta; * RemotePolicy is a service api that can be implemented by a distributed Policy service, * allowing local Policy providers to be updated remotely by a djinn group administrator. * </p><p> - * No service implementation has been provided, DynamicPolicyProvider does - * implement this interface to simplify creation of such a service. + * No service implementation has been provided, RemotePolicyProvider + * implements this interface to simplify creation of such a service. * </p> * <h2>Notes for implementors:</h2> * <p> * For security purposes, only secure jeri Endpoint's should be used and must * require client and server authentication, in addition the proxy must be a * reflective proxy only, as DownloadPermission should not be granted, which is - * also beneficial to reduced network load at the administrator client. + * also beneficial to reduce network load on the administrator client. * RemotePolicy may be submitted to a lookup service, where an administrator - * client will look it up and replace PermissionGrant's periodically. + * client will respond to a ServiceEvent notification, thereby providing the + * RemotePolicy service node, with the permissions requried to participate in + * the djinn, an administrator client will also periodically update policy in + * the djinn. * </p><p> * To reduce network load, the administrator client may delay updates by * lazily processing updates in a serial manner. New RemotePolicy services @@ -49,10 +52,18 @@ import org.apache.river.api.common.Beta; * </p><p> * This policy, in addition to any local policy provider, allows a network djinn * administrator to provide a list of PermissionGrant's, from a single or - * replicated remote location, distributed to all nodes in a djinn that - * administrator is responsible for. Every time the administrator updates - * his network policy, he can use a RemoteEvent notification system to be - * notified for any new RemotePolicy registrations. + * replicated remote location, distributed to all nodes in a djinn. + * </p><p> + * Multiple RemotePolicy's may be in force on a single JVM instance, + * each nested policy service instance may be responsible for updating policy for each + * djinn or group a JVM node joins. + * </p><p> + * RemotePolicy provides a means to dynamically grant permissions required + * by other services provided by the djinn or client Subjects accessing + * services provided by the djinn. + * The JVM that receives policy in the form of PermissionGrant's should limit + * the GrantPermission's granted to a djinn administrator, especially if that + * administrator is from another organisation. * </p><p> * In addition, replicating administrator clients may register a pseudo RemotePolicy * in order to track the primary administrator client and take over in the Modified: river/jtsk/trunk/src/org/apache/river/api/security/RemotePolicyProvider.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/api/security/RemotePolicyProvider.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/api/security/RemotePolicyProvider.java (original) +++ river/jtsk/trunk/src/org/apache/river/api/security/RemotePolicyProvider.java Tue Jan 5 11:06:17 2016 @@ -46,6 +46,7 @@ import net.jini.security.GrantPermission import org.apache.river.api.common.Beta; /** + * An implementation of RemotePolicy. * @author Peter Firmstone * @since 3.0.0 */ @@ -144,13 +145,12 @@ public class RemotePolicyProvider extend // changes between now and gaining the lock, only the length of the // HashSet is potentially not optimal, keeping the HashSet creation // outside of the lock reduces the lock held duration. - Set<ProtectionDomain> domains = null; - int l = grants.length; - for (int i = 0; i < l; i++ ){ + Set<ProtectionDomain> domains = new HashSet<ProtectionDomain>(32); + for (int i = 0, l = grants.length; i < l; i++ ){ if (grants[i] == null ) throw new NullPointerException("null PermissionGrant prohibited"); // This causes a ProtectionDomain security check. final Class c = grants[i].getClass(); - domains = AccessController.doPrivileged( + domains.addAll( AccessController.doPrivileged( new PrivilegedAction<Set<ProtectionDomain>>() { public Set<ProtectionDomain> run() { Class[] classes = c.getDeclaredClasses(); @@ -161,7 +161,7 @@ public class RemotePolicyProvider extend } return domains; } - }); + })); } Iterator<ProtectionDomain> it = domains.iterator(); while (it.hasNext()){ Modified: river/jtsk/trunk/src/org/apache/river/api/util/Startable.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/api/util/Startable.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/api/util/Startable.java (original) +++ river/jtsk/trunk/src/org/apache/river/api/util/Startable.java Tue Jan 5 11:06:17 2016 @@ -22,8 +22,14 @@ package org.apache.river.api.util; * Implemented by an object to enable starting threads, perform remote * export or any other activity after construction is complete, required to put * the object into an operational state. + * <p> + * All services in River now implement Startable to avoid + * exporting a service during construction, for JMM compliance. * * @see org.apache.river.start.ServiceDescriptor + * @see org.apache.river.start.ActivateWrapper + * @see org.apache.river.start.SharedGroupImpl + * @see org.apache.river.start.NonActivatableServiceDescriptor * @see net.jini.export.Exporter * @since 3.0.0 */ Modified: river/jtsk/trunk/src/org/apache/river/fiddler/FiddlerInit.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/fiddler/FiddlerInit.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/fiddler/FiddlerInit.java (original) +++ river/jtsk/trunk/src/org/apache/river/fiddler/FiddlerInit.java Tue Jan 5 11:06:17 2016 @@ -52,7 +52,7 @@ import net.jini.jeri.ServerEndpoint; import net.jini.jeri.tcp.TcpServerEndpoint; import net.jini.security.BasicProxyPreparer; import net.jini.security.ProxyPreparer; -import org.apache.river.impl.thread.NamedThreadFactory; +import org.apache.river.thread.NamedThreadFactory; /** * Initialization common to all modes in which instances of this service Modified: river/jtsk/trunk/src/org/apache/river/mahalo/TxnManagerImpl.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/mahalo/TxnManagerImpl.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/mahalo/TxnManagerImpl.java (original) +++ river/jtsk/trunk/src/org/apache/river/mahalo/TxnManagerImpl.java Tue Jan 5 11:06:17 2016 @@ -97,8 +97,8 @@ import net.jini.lookup.entry.ServiceInfo import net.jini.security.ProxyPreparer; import net.jini.security.proxytrust.ServerProxyTrust; import net.jini.security.TrustVerifier; -import org.apache.river.impl.thread.ExtensibleExecutorService; -import org.apache.river.impl.thread.ExtensibleExecutorService.RunnableFutureFactory; +import org.apache.river.thread.ExtensibleExecutorService; +import org.apache.river.thread.ExtensibleExecutorService.RunnableFutureFactory; /** * An implementation of the Jini Transaction Specification. Modified: river/jtsk/trunk/src/org/apache/river/mahalo/TxnManagerImplInitializer.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/mahalo/TxnManagerImplInitializer.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/mahalo/TxnManagerImplInitializer.java (original) +++ river/jtsk/trunk/src/org/apache/river/mahalo/TxnManagerImplInitializer.java Tue Jan 5 11:06:17 2016 @@ -51,7 +51,7 @@ import net.jini.jeri.BasicJeriExporter; import net.jini.jeri.tcp.TcpServerEndpoint; import net.jini.security.BasicProxyPreparer; import net.jini.security.ProxyPreparer; -import org.apache.river.impl.thread.NamedThreadFactory; +import org.apache.river.thread.NamedThreadFactory; /** * Modified: river/jtsk/trunk/src/org/apache/river/mercury/MailboxImpl.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/mercury/MailboxImpl.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/mercury/MailboxImpl.java (original) +++ river/jtsk/trunk/src/org/apache/river/mercury/MailboxImpl.java Tue Jan 5 11:06:17 2016 @@ -119,7 +119,7 @@ import net.jini.lookup.entry.ServiceInfo import net.jini.lookup.JoinManager; import net.jini.discovery.LookupDiscovery; import net.jini.io.MarshalledInstance; -import org.apache.river.impl.thread.NamedThreadFactory; +import org.apache.river.thread.NamedThreadFactory; /** * <tt>MailboxImpl</tt> implements the server side of the event Modified: river/jtsk/trunk/src/org/apache/river/norm/event/EventTypeGenerator.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/norm/event/EventTypeGenerator.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/norm/event/EventTypeGenerator.java (original) +++ river/jtsk/trunk/src/org/apache/river/norm/event/EventTypeGenerator.java Tue Jan 5 11:06:17 2016 @@ -25,7 +25,7 @@ import java.util.concurrent.ExecutorServ import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import org.apache.river.impl.thread.NamedThreadFactory; +import org.apache.river.thread.NamedThreadFactory; /** * Factory class for <code>EventType</code> objects. All Modified: river/jtsk/trunk/src/org/apache/river/outrigger/Notifier.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/outrigger/Notifier.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/outrigger/Notifier.java (original) +++ river/jtsk/trunk/src/org/apache/river/outrigger/Notifier.java Tue Jan 5 11:06:17 2016 @@ -36,7 +36,7 @@ import java.util.concurrent.ExecutorServ import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import org.apache.river.impl.thread.NamedThreadFactory; +import org.apache.river.thread.NamedThreadFactory; /** * The notifier thread. This thread is responsible for notifying Modified: river/jtsk/trunk/src/org/apache/river/outrigger/TxnMonitor.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/outrigger/TxnMonitor.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/outrigger/TxnMonitor.java (original) +++ river/jtsk/trunk/src/org/apache/river/outrigger/TxnMonitor.java Tue Jan 5 11:06:17 2016 @@ -32,7 +32,7 @@ import java.util.concurrent.ThreadPoolEx import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.logging.Logger; -import org.apache.river.impl.thread.NamedThreadFactory; +import org.apache.river.thread.NamedThreadFactory; /** * This class provides a driver for monitoring the state of transactions Modified: river/jtsk/trunk/src/org/apache/river/reggie/RegistrarImpl.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/reggie/RegistrarImpl.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/reggie/RegistrarImpl.java (original) +++ river/jtsk/trunk/src/org/apache/river/reggie/RegistrarImpl.java Tue Jan 5 11:06:17 2016 @@ -149,8 +149,8 @@ import net.jini.security.ProxyPreparer; import net.jini.security.TrustVerifier; import net.jini.security.proxytrust.ServerProxyTrust; import org.apache.river.api.util.Startable; -import org.apache.river.impl.thread.NamedThreadFactory; -import org.apache.river.impl.thread.SynchronousExecutors; +import org.apache.river.thread.NamedThreadFactory; +import org.apache.river.thread.SynchronousExecutors; /** * Base server-side implementation of a lookup service, subclassed by Copied: river/jtsk/trunk/src/org/apache/river/thread/DependencyLinker.java (from r1721711, river/jtsk/trunk/src/org/apache/river/impl/thread/DependencyLinker.java) URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/thread/DependencyLinker.java?p2=river/jtsk/trunk/src/org/apache/river/thread/DependencyLinker.java&p1=river/jtsk/trunk/src/org/apache/river/impl/thread/DependencyLinker.java&r1=1721711&r2=1723044&rev=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/impl/thread/DependencyLinker.java (original) +++ river/jtsk/trunk/src/org/apache/river/thread/DependencyLinker.java Tue Jan 5 11:06:17 2016 @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.river.impl.thread; +package org.apache.river.thread; import java.util.ArrayList; import java.util.Iterator; @@ -24,7 +24,6 @@ import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import java.util.concurrent.RunnableFuture; -import org.apache.river.api.util.FutureObserver; /** * Copied: river/jtsk/trunk/src/org/apache/river/thread/ExtensibleExecutorService.java (from r1721711, river/jtsk/trunk/src/org/apache/river/impl/thread/ExtensibleExecutorService.java) URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/thread/ExtensibleExecutorService.java?p2=river/jtsk/trunk/src/org/apache/river/thread/ExtensibleExecutorService.java&p1=river/jtsk/trunk/src/org/apache/river/impl/thread/ExtensibleExecutorService.java&r1=1721711&r2=1723044&rev=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/impl/thread/ExtensibleExecutorService.java (original) +++ river/jtsk/trunk/src/org/apache/river/thread/ExtensibleExecutorService.java Tue Jan 5 11:06:17 2016 @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.river.impl.thread; +package org.apache.river.thread; import java.util.List; import java.util.concurrent.AbstractExecutorService; Copied: river/jtsk/trunk/src/org/apache/river/thread/FutureObserver.java (from r1721711, river/jtsk/trunk/src/org/apache/river/api/util/FutureObserver.java) URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/thread/FutureObserver.java?p2=river/jtsk/trunk/src/org/apache/river/thread/FutureObserver.java&p1=river/jtsk/trunk/src/org/apache/river/api/util/FutureObserver.java&r1=1721711&r2=1723044&rev=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/api/util/FutureObserver.java (original) +++ river/jtsk/trunk/src/org/apache/river/thread/FutureObserver.java Tue Jan 5 11:06:17 2016 @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.river.api.util; +package org.apache.river.thread; import java.util.EventListener; import java.util.concurrent.Future; Copied: river/jtsk/trunk/src/org/apache/river/thread/NamedThreadFactory.java (from r1721711, river/jtsk/trunk/src/org/apache/river/impl/thread/NamedThreadFactory.java) URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/thread/NamedThreadFactory.java?p2=river/jtsk/trunk/src/org/apache/river/thread/NamedThreadFactory.java&p1=river/jtsk/trunk/src/org/apache/river/impl/thread/NamedThreadFactory.java&r1=1721711&r2=1723044&rev=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/impl/thread/NamedThreadFactory.java (original) +++ river/jtsk/trunk/src/org/apache/river/thread/NamedThreadFactory.java Tue Jan 5 11:06:17 2016 @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.river.impl.thread; +package org.apache.river.thread; import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicInteger; Copied: river/jtsk/trunk/src/org/apache/river/thread/ObservableFutureTask.java (from r1721711, river/jtsk/trunk/src/org/apache/river/impl/thread/ObservableFutureTask.java) URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/thread/ObservableFutureTask.java?p2=river/jtsk/trunk/src/org/apache/river/thread/ObservableFutureTask.java&p1=river/jtsk/trunk/src/org/apache/river/impl/thread/ObservableFutureTask.java&r1=1721711&r2=1723044&rev=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/impl/thread/ObservableFutureTask.java (original) +++ river/jtsk/trunk/src/org/apache/river/thread/ObservableFutureTask.java Tue Jan 5 11:06:17 2016 @@ -16,15 +16,14 @@ * limitations under the License. */ -package org.apache.river.impl.thread; +package org.apache.river.thread; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.concurrent.Callable; import java.util.concurrent.FutureTask; -import org.apache.river.api.util.FutureObserver; -import org.apache.river.api.util.FutureObserver.ObservableFuture; +import org.apache.river.thread.FutureObserver.ObservableFuture; /** * Modified: river/jtsk/trunk/src/org/apache/river/thread/RetryTask.java URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/thread/RetryTask.java?rev=1723044&r1=1723043&r2=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/thread/RetryTask.java (original) +++ river/jtsk/trunk/src/org/apache/river/thread/RetryTask.java Tue Jan 5 11:06:17 2016 @@ -72,8 +72,7 @@ import java.util.concurrent.RunnableFutu import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.river.api.util.FutureObserver; -import org.apache.river.api.util.FutureObserver.ObservableFuture; +import org.apache.river.thread.FutureObserver.ObservableFuture; /** * Copied: river/jtsk/trunk/src/org/apache/river/thread/SynchronousExecutors.java (from r1721711, river/jtsk/trunk/src/org/apache/river/impl/thread/SynchronousExecutors.java) URL: http://svn.apache.org/viewvc/river/jtsk/trunk/src/org/apache/river/thread/SynchronousExecutors.java?p2=river/jtsk/trunk/src/org/apache/river/thread/SynchronousExecutors.java&p1=river/jtsk/trunk/src/org/apache/river/impl/thread/SynchronousExecutors.java&r1=1721711&r2=1723044&rev=1723044&view=diff ============================================================================== --- river/jtsk/trunk/src/org/apache/river/impl/thread/SynchronousExecutors.java (original) +++ river/jtsk/trunk/src/org/apache/river/thread/SynchronousExecutors.java Tue Jan 5 11:06:17 2016 @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.river.impl.thread; +package org.apache.river.thread; import java.util.AbstractQueue; import java.util.ArrayList; Copied: river/jtsk/trunk/test/src/org/apache/river/thread/SynchronousExecutorsTest.java (from r1721711, river/jtsk/trunk/test/src/org/apache/river/impl/thread/SynchronousExecutorsTest.java) URL: http://svn.apache.org/viewvc/river/jtsk/trunk/test/src/org/apache/river/thread/SynchronousExecutorsTest.java?p2=river/jtsk/trunk/test/src/org/apache/river/thread/SynchronousExecutorsTest.java&p1=river/jtsk/trunk/test/src/org/apache/river/impl/thread/SynchronousExecutorsTest.java&r1=1721711&r2=1723044&rev=1723044&view=diff ============================================================================== --- river/jtsk/trunk/test/src/org/apache/river/impl/thread/SynchronousExecutorsTest.java (original) +++ river/jtsk/trunk/test/src/org/apache/river/thread/SynchronousExecutorsTest.java Tue Jan 5 11:06:17 2016 @@ -16,7 +16,7 @@ * limitations under the License. */ -package org.apache.river.impl.thread; +package org.apache.river.thread; import java.rmi.RemoteException; import java.util.Collection;
