You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2007/11/12 23:23:28 UTC
svn commit: r594319 [33/40] - in /tapestry/tapestry5/trunk: ./
tapestry-annotations/
tapestry-annotations/src/main/java/org/apache/tapestry/beaneditor/
tapestry-annotations/src/site/ tapestry-component-report/
tapestry-component-report/src/main/java/or...
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/OrIdMatcher.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/OrIdMatcher.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/OrIdMatcher.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/OrIdMatcher.java Mon Nov 12 14:22:31 2007
@@ -1,27 +1,25 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.ioc.internal;
-import java.util.Collection;
-
-import org.apache.tapestry.ioc.IdMatcher;
+import org.apache.tapestry.ioc.IdMatcher;
+
+import java.util.Collection;
/**
* A wrapper around a collection of IdMatchers. A match occurs if <em>any</em> matcher matches.
- *
- *
*/
public final class OrIdMatcher implements IdMatcher
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/RecursiveServiceCreationCheckWrapper.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/RecursiveServiceCreationCheckWrapper.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/RecursiveServiceCreationCheckWrapper.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/RecursiveServiceCreationCheckWrapper.java Mon Nov 12 14:22:31 2007
@@ -36,7 +36,7 @@
private boolean _locked;
public RecursiveServiceCreationCheckWrapper(ServiceDef serviceDef, ObjectCreator delegate,
- Logger logger)
+ Logger logger)
{
_serviceDef = serviceDef;
_delegate = delegate;
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/RegistryImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/RegistryImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/RegistryImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/RegistryImpl.java Mon Nov 12 14:22:31 2007
@@ -14,33 +14,7 @@
package org.apache.tapestry.ioc.internal;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newCaseInsensitiveMap;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newMap;
-import static org.apache.tapestry.ioc.internal.util.Defense.notNull;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tapestry.ioc.AnnotationProvider;
-import org.apache.tapestry.ioc.Configuration;
-import org.apache.tapestry.ioc.IOCConstants;
-import org.apache.tapestry.ioc.LoggerSource;
-import org.apache.tapestry.ioc.MappedConfiguration;
-import org.apache.tapestry.ioc.ObjectCreator;
-import org.apache.tapestry.ioc.ObjectLocator;
-import org.apache.tapestry.ioc.ObjectProvider;
-import org.apache.tapestry.ioc.OrderedConfiguration;
-import org.apache.tapestry.ioc.Registry;
-import org.apache.tapestry.ioc.ServiceBuilderResources;
-import org.apache.tapestry.ioc.ServiceDecorator;
-import org.apache.tapestry.ioc.ServiceLifecycle;
-import org.apache.tapestry.ioc.ServiceResources;
+import org.apache.tapestry.ioc.*;
import org.apache.tapestry.ioc.def.ContributionDef;
import org.apache.tapestry.ioc.def.DecoratorDef;
import org.apache.tapestry.ioc.def.ModuleDef;
@@ -48,24 +22,19 @@
import org.apache.tapestry.ioc.internal.services.RegistryShutdownHubImpl;
import org.apache.tapestry.ioc.internal.services.ThreadCleanupHubImpl;
import org.apache.tapestry.ioc.internal.util.CollectionFactory;
+import static org.apache.tapestry.ioc.internal.util.CollectionFactory.*;
+import static org.apache.tapestry.ioc.internal.util.Defense.notNull;
import org.apache.tapestry.ioc.internal.util.InternalUtils;
import org.apache.tapestry.ioc.internal.util.OneShotLock;
import org.apache.tapestry.ioc.internal.util.Orderer;
-import org.apache.tapestry.ioc.services.Builtin;
-import org.apache.tapestry.ioc.services.ClassFab;
-import org.apache.tapestry.ioc.services.ClassFabUtils;
-import org.apache.tapestry.ioc.services.ClassFactory;
-import org.apache.tapestry.ioc.services.RegistryShutdownHub;
-import org.apache.tapestry.ioc.services.RegistryShutdownListener;
-import org.apache.tapestry.ioc.services.ServiceActivityScoreboard;
-import org.apache.tapestry.ioc.services.ServiceLifecycleSource;
-import org.apache.tapestry.ioc.services.Status;
-import org.apache.tapestry.ioc.services.SymbolSource;
-import org.apache.tapestry.ioc.services.TapestryIOCModule;
-import org.apache.tapestry.ioc.services.ThreadCleanupHub;
+import org.apache.tapestry.ioc.services.*;
import org.apache.tapestry.services.MasterObjectProvider;
import org.slf4j.Logger;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.*;
+
public class RegistryImpl implements Registry, InternalRegistry
{
private static final String SYMBOL_SOURCE_SERVICE_ID = "SymbolSource";
@@ -76,7 +45,9 @@
private static final String SERVICE_ACTIVITY_SCOREBOARD_SERVICE_ID = "ServiceActivityScoreboard";
- /** The set of marker annotations for a builtin service. */
+ /**
+ * The set of marker annotations for a builtin service.
+ */
private final static Set<Class> BUILTIN = CollectionFactory.newSet();
static
@@ -104,7 +75,9 @@
private final LoggerSource _loggerSource;
- /** Map from service id to the Module that contains the service. */
+ /**
+ * Map from service id to the Module that contains the service.
+ */
private final Map<String, Module> _serviceIdToModule = newCaseInsensitiveMap();
private final Map<String, ServiceLifecycle> _lifecycles = newCaseInsensitiveMap();
@@ -125,7 +98,7 @@
private final Map<Class, List<ServiceDef>> _markerToServiceDef = newMap();
public static final class OrderedConfigurationToOrdererAdaptor<T> implements
- OrderedConfiguration<T>
+ OrderedConfiguration<T>
{
private final Orderer<T> _orderer;
@@ -142,16 +115,13 @@
/**
* Constructs the registry from a set of module definitions and other resources.
- *
- * @param moduleDefs
- * defines the modules (and builders, decorators, etc., within)
- * @param classFactory
- * TODO
- * @param loggerSource
- * used to obtain Logger instances
+ *
+ * @param moduleDefs defines the modules (and builders, decorators, etc., within)
+ * @param classFactory TODO
+ * @param loggerSource used to obtain Logger instances
*/
public RegistryImpl(Collection<ModuleDef> moduleDefs, ClassFactory classFactory,
- LoggerSource loggerSource)
+ LoggerSource loggerSource)
{
_loggerSource = loggerSource;
@@ -313,7 +283,9 @@
_registryShutdownHub.fireRegistryDidShutdown();
}
- /** Internal access, usually from another module. */
+ /**
+ * Internal access, usually from another module.
+ */
public <T> T getService(String serviceId, Class<T> serviceInterface)
{
_lock.check();
@@ -411,7 +383,7 @@
ObjectProvider contribution = new ObjectProvider()
{
public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider,
- ObjectLocator locator)
+ ObjectLocator locator)
{
return findServiceByMarkerAndType(objectType, annotationProvider);
}
@@ -424,7 +396,7 @@
}
public <K, V> Map<K, V> getMappedConfiguration(ServiceDef serviceDef, Class<K> keyType,
- Class<V> objectType)
+ Class<V> objectType)
{
_lock.check();
@@ -469,8 +441,9 @@
}
private <K, V> void addToMappedConfiguration(MappedConfiguration<K, V> configuration,
- Map<K, ContributionDef> keyToContribution, Class<K> keyClass, Class<V> valueType,
- ServiceDef serviceDef, Module module)
+ Map<K, ContributionDef> keyToContribution, Class<K> keyClass,
+ Class<V> valueType,
+ ServiceDef serviceDef, Module module)
{
String serviceId = serviceDef.getServiceId();
Set<ContributionDef> contributions = module.getContributorDefsForService(serviceId);
@@ -482,7 +455,7 @@
boolean debug = logger.isDebugEnabled();
ObjectLocator locator = new ServiceResourcesImpl(this, module, serviceDef, _classFactory,
- logger);
+ logger);
for (ContributionDef def : contributions)
{
@@ -497,7 +470,7 @@
}
private <T> void addToUnorderedConfiguration(Configuration<T> configuration,
- Class<T> valueType, ServiceDef serviceDef, Module module)
+ Class<T> valueType, ServiceDef serviceDef, Module module)
{
String serviceId = serviceDef.getServiceId();
Set<ContributionDef> contributions = module.getContributorDefsForService(serviceId);
@@ -509,12 +482,12 @@
boolean debug = logger.isDebugEnabled();
ObjectLocator locator = new ServiceResourcesImpl(this, module, serviceDef, _classFactory,
- logger);
+ logger);
for (ContributionDef def : contributions)
{
Configuration<T> validating = new ValidatingConfigurationWrapper<T>(serviceId, logger,
- valueType, def, configuration);
+ valueType, def, configuration);
if (debug) logger.debug(IOCMessages.invokingMethod(def));
@@ -523,7 +496,7 @@
}
private <T> void addToOrderedConfiguration(OrderedConfiguration<T> configuration,
- Class<T> valueType, ServiceDef serviceDef, Module module)
+ Class<T> valueType, ServiceDef serviceDef, Module module)
{
String serviceId = serviceDef.getServiceId();
Set<ContributionDef> contributions = module.getContributorDefsForService(serviceId);
@@ -534,7 +507,7 @@
boolean debug = logger.isDebugEnabled();
ObjectLocator locator = new ServiceResourcesImpl(this, module, serviceDef, _classFactory,
- logger);
+ logger);
for (ContributionDef def : contributions)
{
@@ -630,7 +603,7 @@
if (decorators.isEmpty()) continue;
ServiceResources resources = new ServiceResourcesImpl(this, module, serviceDef,
- _classFactory, logger);
+ _classFactory, logger);
for (DecoratorDef dd : decorators)
{
@@ -651,12 +624,12 @@
}
private <T> T getObject(Class<T> objectType, AnnotationProvider annotationProvider,
- ObjectLocator locator)
+ ObjectLocator locator)
{
_lock.check();
AnnotationProvider effectiveProvider = annotationProvider != null ? annotationProvider
- : new NullAnnotationProvider();
+ : new NullAnnotationProvider();
// We do a check here for known marker/type combinations, so that you can use a marker
// annotation
@@ -749,7 +722,9 @@
return getSymbolSource().expandSymbols(input);
}
- /** Defers obtaining the symbol source until actually needed. */
+ /**
+ * Defers obtaining the symbol source until actually needed.
+ */
private synchronized SymbolSource getSymbolSource()
{
if (_symbolSource == null)
@@ -794,7 +769,7 @@
String description = _classFactory.getConstructorLocation(constructor).toString();
throw new RuntimeException(IOCMessages.autobuildConstructorError(description, failure),
- failure);
+ failure);
}
public <T> T proxy(Class<T> interfaceClass, final Class<? extends T> implementationClass)
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceActivityTracker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceActivityTracker.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceActivityTracker.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceActivityTracker.java Mon Nov 12 14:22:31 2007
@@ -26,21 +26,17 @@
/**
* Defines a service in the tracker with an initial status.
- *
- * @param serviceDef
- * the service being defined
- * @param initialStatus
- * typically {@link Status#BUILTIN} or {@link Status#DEFINED}
+ *
+ * @param serviceDef the service being defined
+ * @param initialStatus typically {@link Status#BUILTIN} or {@link Status#DEFINED}
*/
void define(ServiceDef serviceDef, Status initialStatus);
/**
* Updates the status for the service.
- *
- * @param serviceId
- * identifies the service, which must be previously defined
- * @param status
- * the new status value
+ *
+ * @param serviceId identifies the service, which must be previously defined
+ * @param status the new status value
*/
void setStatus(String serviceId, Status status);
}
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceActivityTrackerImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceActivityTrackerImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceActivityTrackerImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceActivityTrackerImpl.java Mon Nov 12 14:22:31 2007
@@ -14,18 +14,18 @@
package org.apache.tapestry.ioc.internal;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-
import org.apache.tapestry.ioc.def.ServiceDef;
import org.apache.tapestry.ioc.internal.util.CollectionFactory;
import org.apache.tapestry.ioc.services.ServiceActivity;
import org.apache.tapestry.ioc.services.ServiceActivityScoreboard;
import org.apache.tapestry.ioc.services.Status;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
public class ServiceActivityTrackerImpl implements ServiceActivityScoreboard,
- ServiceActivityTracker
+ ServiceActivityTracker
{
public static class MutableServiceActivity implements ServiceActivity
{
@@ -67,7 +67,9 @@
}
}
- /** Tree map keeps everything in order by key (serviceId). */
+ /**
+ * Tree map keeps everything in order by key (serviceId).
+ */
private final Map<String, MutableServiceActivity> _serviceIdToServiceStatus = new TreeMap<String, MutableServiceActivity>();
public synchronized List<ServiceActivity> getServiceActivity()
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceBinderImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceBinderImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceBinderImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceBinderImpl.java Mon Nov 12 14:22:31 2007
@@ -14,28 +14,23 @@
package org.apache.tapestry.ioc.internal;
-import static org.apache.tapestry.ioc.internal.util.Defense.notBlank;
-import static org.apache.tapestry.ioc.internal.util.Defense.notNull;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.util.Arrays;
-import java.util.Set;
-
-import org.apache.tapestry.ioc.IOCConstants;
-import org.apache.tapestry.ioc.ObjectCreator;
-import org.apache.tapestry.ioc.ServiceBinder;
-import org.apache.tapestry.ioc.ServiceBindingOptions;
-import org.apache.tapestry.ioc.ServiceBuilderResources;
+import org.apache.tapestry.ioc.*;
import org.apache.tapestry.ioc.annotations.EagerLoad;
import org.apache.tapestry.ioc.annotations.Marker;
import org.apache.tapestry.ioc.annotations.Scope;
import org.apache.tapestry.ioc.def.ServiceDef;
import org.apache.tapestry.ioc.internal.util.CollectionFactory;
+import static org.apache.tapestry.ioc.internal.util.Defense.notBlank;
+import static org.apache.tapestry.ioc.internal.util.Defense.notNull;
import org.apache.tapestry.ioc.internal.util.InternalUtils;
import org.apache.tapestry.ioc.internal.util.OneShotLock;
import org.apache.tapestry.ioc.services.ClassFactory;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.util.Arrays;
+import java.util.Set;
+
public class ServiceBinderImpl implements ServiceBinder, ServiceBindingOptions
{
private final OneShotLock _lock = new OneShotLock();
@@ -47,7 +42,7 @@
private final Set<Class> _defaultMarkers;
public ServiceBinderImpl(ServiceDefAccumulator accumulator, ClassFactory classFactory,
- Set<Class> defaultMarkers)
+ Set<Class> defaultMarkers)
{
_accumulator = accumulator;
_classFactory = classFactory;
@@ -97,7 +92,7 @@
markers.addAll(_markers);
ServiceDef serviceDef = new ServiceDefImpl(_serviceInterface, _serviceId, markers, _scope,
- _eagerLoad, source);
+ _eagerLoad, source);
_accumulator.addServiceDef(serviceDef);
@@ -126,7 +121,7 @@
}
public <T> ServiceBindingOptions bind(Class<T> serviceInterface,
- Class<? extends T> serviceImplementation)
+ Class<? extends T> serviceImplementation)
{
notNull(serviceInterface, "serviceIterface");
notNull(serviceImplementation, "serviceImplementation");
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceBuilderMethodInvoker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceBuilderMethodInvoker.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceBuilderMethodInvoker.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceBuilderMethodInvoker.java Mon Nov 12 14:22:31 2007
@@ -14,13 +14,13 @@
package org.apache.tapestry.ioc.internal;
+import org.apache.tapestry.ioc.ServiceBuilderResources;
+import org.apache.tapestry.ioc.internal.util.InternalUtils;
+
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Map;
-import org.apache.tapestry.ioc.ServiceBuilderResources;
-import org.apache.tapestry.ioc.internal.util.InternalUtils;
-
/**
* Basic implementation of {@link org.apache.tapestry.ioc.ObjectCreator} that handles invoking a
* method on the module builder, and figures out the correct parameters to pass into the annotated
@@ -31,7 +31,7 @@
private final Method _builderMethod;
public ServiceBuilderMethodInvoker(ServiceBuilderResources resources,
- String creatorDescription, Method method)
+ String creatorDescription, Method method)
{
super(resources, creatorDescription);
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceDecoratorImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceDecoratorImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceDecoratorImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceDecoratorImpl.java Mon Nov 12 14:22:31 2007
@@ -14,19 +14,18 @@
package org.apache.tapestry.ioc.internal;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newMap;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Map;
-
import org.apache.tapestry.ioc.ModuleBuilderSource;
import org.apache.tapestry.ioc.ServiceDecorator;
import org.apache.tapestry.ioc.ServiceResources;
+import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newMap;
import org.apache.tapestry.ioc.internal.util.InternalUtils;
import org.apache.tapestry.ioc.services.ClassFactory;
import org.slf4j.Logger;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Map;
+
/**
* A wrapper around a decorator method.
*/
@@ -49,7 +48,7 @@
private final Class _serviceInterface;
public ServiceDecoratorImpl(Method method, ModuleBuilderSource moduleBuilderSource,
- ServiceResources resources, ClassFactory classFactory)
+ ServiceResources resources, ClassFactory classFactory)
{
_serviceId = resources.getServiceId();
_decoratorMethod = method;
@@ -84,7 +83,7 @@
Throwable failure = null;
Object moduleBuilder = InternalUtils.isStatic(_decoratorMethod) ? null
- : _moduleBuilderSource.getModuleBuilder();
+ : _moduleBuilderSource.getModuleBuilder();
try
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceDefImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceDefImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceDefImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceDefImpl.java Mon Nov 12 14:22:31 2007
@@ -14,13 +14,13 @@
package org.apache.tapestry.ioc.internal;
-import java.util.Set;
-
import org.apache.tapestry.ioc.IOCConstants;
import org.apache.tapestry.ioc.ObjectCreator;
import org.apache.tapestry.ioc.ServiceBuilderResources;
import org.apache.tapestry.ioc.def.ServiceDef;
+import java.util.Set;
+
public class ServiceDefImpl implements ServiceDef
{
private final Class _serviceInterface;
@@ -36,22 +36,16 @@
private final Set<Class> _markers;
/**
- * @param serviceInterface
- * interface implemented by the service (or the service implementation class, for
- * non-proxied services)
- * @param serviceId
- * unique id for the service
- * @param markers
- * set of marker annotation classes (will be retained not copied)
- * @param scope
- * scope of the service (i.e., {@link IOCConstants#DEFAULT_SCOPE}).
- * @param eagerLoad
- * if true, the service is realized at startup, rather than on-demand
- * @param source
- * used to create the service implementation when needed
+ * @param serviceInterface interface implemented by the service (or the service implementation class, for
+ * non-proxied services)
+ * @param serviceId unique id for the service
+ * @param markers set of marker annotation classes (will be retained not copied)
+ * @param scope scope of the service (i.e., {@link IOCConstants#DEFAULT_SCOPE}).
+ * @param eagerLoad if true, the service is realized at startup, rather than on-demand
+ * @param source used to create the service implementation when needed
*/
ServiceDefImpl(Class serviceInterface, String serviceId, Set<Class> markers, String scope,
- boolean eagerLoad, ObjectCreatorSource source)
+ boolean eagerLoad, ObjectCreatorSource source)
{
_serviceInterface = serviceInterface;
_serviceId = serviceId;
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceResourcesImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceResourcesImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceResourcesImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ServiceResourcesImpl.java Mon Nov 12 14:22:31 2007
@@ -14,20 +14,19 @@
package org.apache.tapestry.ioc.internal;
-import static org.apache.tapestry.ioc.internal.util.Defense.notNull;
-
-import java.lang.reflect.Constructor;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
import org.apache.tapestry.ioc.ObjectCreator;
import org.apache.tapestry.ioc.ServiceBuilderResources;
import org.apache.tapestry.ioc.def.ServiceDef;
+import static org.apache.tapestry.ioc.internal.util.Defense.notNull;
import org.apache.tapestry.ioc.internal.util.InternalUtils;
import org.apache.tapestry.ioc.services.ClassFactory;
import org.slf4j.Logger;
+import java.lang.reflect.Constructor;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
/**
* Implementation of {@link org.apache.tapestry.ioc.ServiceBuilderResources}. We just have one
* implementation that fills the purposes of methods that need a
@@ -45,7 +44,7 @@
private final ClassFactory _classFactory;
public ServiceResourcesImpl(InternalRegistry registry, Module module, ServiceDef serviceDef,
- ClassFactory classFactory, Logger logger)
+ ClassFactory classFactory, Logger logger)
{
super(registry, module);
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/SingletonServiceLifecycle.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/SingletonServiceLifecycle.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/SingletonServiceLifecycle.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/SingletonServiceLifecycle.java Mon Nov 12 14:22:31 2007
@@ -1,28 +1,26 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.ioc.internal;
-import org.apache.tapestry.ioc.ObjectCreator;
-import org.apache.tapestry.ioc.ServiceLifecycle;
-import org.apache.tapestry.ioc.ServiceResources;
+import org.apache.tapestry.ioc.ObjectCreator;
+import org.apache.tapestry.ioc.ServiceLifecycle;
+import org.apache.tapestry.ioc.ServiceResources;
/**
* The basic implementation of a service lifecycle, which simply uses the
* {@link org.apache.tapestry.ioc.ObjectCreator} to create an instance of the service when asked.
- *
- *
*/
public class SingletonServiceLifecycle implements ServiceLifecycle
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ValidatingConfigurationWrapper.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ValidatingConfigurationWrapper.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ValidatingConfigurationWrapper.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ValidatingConfigurationWrapper.java Mon Nov 12 14:22:31 2007
@@ -36,7 +36,7 @@
// Need a strategy for determing the right order for this mass of parameters!
public ValidatingConfigurationWrapper(String serviceId, Logger logger, Class expectedType,
- ContributionDef contributionDef, Configuration<T> delegate)
+ ContributionDef contributionDef, Configuration<T> delegate)
{
_serviceId = serviceId;
_logger = logger;
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ValidatingMappedConfigurationWrapper.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ValidatingMappedConfigurationWrapper.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ValidatingMappedConfigurationWrapper.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ValidatingMappedConfigurationWrapper.java Mon Nov 12 14:22:31 2007
@@ -14,12 +14,12 @@
package org.apache.tapestry.ioc.internal;
-import java.util.Map;
-
import org.apache.tapestry.ioc.MappedConfiguration;
import org.apache.tapestry.ioc.def.ContributionDef;
import org.slf4j.Logger;
+import java.util.Map;
+
/**
* Provides two forms of validation for mapped configurations:
* <ul>
@@ -27,9 +27,9 @@
* <li>If the key has previously been stored (by some other
* {@link org.apache.tapestry.ioc.def.ContributionDef}, then a warning is logged</li>
* </ul>
- * <p>
+ * <p/>
* When a warning is logged, the key/value pair is not added to the delegate.
- *
+ *
* @param <K>
* @param <V>
*/
@@ -50,8 +50,9 @@
private final MappedConfiguration<K, V> _delegate;
public ValidatingMappedConfigurationWrapper(String serviceId, ContributionDef contributionDef,
- Logger logger, Class<K> expectedKeyType, Class<V> expectedValueType,
- Map<K, ContributionDef> keyToContributor, MappedConfiguration<K, V> delegate)
+ Logger logger, Class<K> expectedKeyType, Class<V> expectedValueType,
+ Map<K, ContributionDef> keyToContributor,
+ MappedConfiguration<K, V> delegate)
{
_serviceId = serviceId;
_contributionDef = contributionDef;
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ValidatingOrderedConfigurationWrapper.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ValidatingOrderedConfigurationWrapper.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ValidatingOrderedConfigurationWrapper.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/ValidatingOrderedConfigurationWrapper.java Mon Nov 12 14:22:31 2007
@@ -24,7 +24,7 @@
* the value is converted to null but added anyway. This ensures that incorrect values contributed
* in don't screw up the {@link org.apache.tapestry.ioc.internal.util.Orderer} (and generate a bunch
* of error messages there).
- *
+ *
* @param <T>
*/
public class ValidatingOrderedConfigurationWrapper<T> implements OrderedConfiguration<T>
@@ -40,7 +40,7 @@
private final OrderedConfiguration<T> _delegate;
public ValidatingOrderedConfigurationWrapper(String serviceId, ContributionDef contributionDef,
- Logger logger, Class expectedType, OrderedConfiguration<T> delegate)
+ Logger logger, Class expectedType, OrderedConfiguration<T> delegate)
{
_serviceId = serviceId;
_contributionDef = contributionDef;
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/AbstractFab.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/AbstractFab.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/AbstractFab.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/AbstractFab.java Mon Nov 12 14:22:31 2007
@@ -14,14 +14,12 @@
package org.apache.tapestry.ioc.internal.services;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newMap;
-
-import java.util.Map;
-
import javassist.CtClass;
-
+import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newMap;
import org.apache.tapestry.ioc.internal.util.OneShotLock;
import org.slf4j.Logger;
+
+import java.util.Map;
/**
* Base class for {@link org.apache.tapestry.ioc.internal.services.ClassFabImpl}. This code is a
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/BridgeBuilder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/BridgeBuilder.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/BridgeBuilder.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/BridgeBuilder.java Mon Nov 12 14:22:31 2007
@@ -14,20 +14,19 @@
package org.apache.tapestry.ioc.internal.services;
-import static java.lang.String.format;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Modifier;
-import java.util.Iterator;
-import java.util.List;
-
import org.apache.tapestry.ioc.services.ClassFab;
import org.apache.tapestry.ioc.services.ClassFactory;
import org.apache.tapestry.ioc.services.MethodIterator;
import org.apache.tapestry.ioc.services.MethodSignature;
import org.slf4j.Logger;
+import static java.lang.String.format;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Modifier;
+import java.util.Iterator;
+import java.util.List;
+
/**
* Used by the {@link org.apache.tapestry.ioc.internal.services.PipelineBuilderImpl} to create
* bridge classes and to create instances of bridge classes. A bridge class implements the
@@ -49,7 +48,7 @@
private Constructor _constructor;
BridgeBuilder(Logger logger, Class<S> serviceInterface, Class<F> filterInterface,
- ClassFactory classFactory)
+ ClassFactory classFactory)
{
_logger = logger;
_serviceInterface = serviceInterface;
@@ -112,18 +111,16 @@
_classFab.addField("_filter", Modifier.PRIVATE | Modifier.FINAL, _filterInterface);
_classFab.addConstructor(new Class[]
- { _serviceInterface, _filterInterface }, null, "{ _next = $1; _filter = $2; }");
+ {_serviceInterface, _filterInterface}, null, "{ _next = $1; _filter = $2; }");
_classFab.addInterface(_serviceInterface);
}
/**
* Instantiates a bridge object.
- *
- * @param nextBridge
- * the next Bridge object in the pipeline, or the terminator service
- * @param filter
- * the filter object for this step of the pipeline
+ *
+ * @param nextBridge the next Bridge object in the pipeline, or the terminator service
+ * @param filter the filter object for this step of the pipeline
*/
public S instantiateBridge(S nextBridge, F filter)
{
@@ -158,7 +155,7 @@
* Finds a matching method in filterMethods for the given service method. A matching method has
* the same signature as the service interface method, but with an additional parameter matching
* the service interface itself.
- * <p>
+ * <p/>
* The matching method signature from the list of filterMethods is removed and code generation
* strategies for making the two methods call each other are added.
*/
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ChainBuilderImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ChainBuilderImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ChainBuilderImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ChainBuilderImpl.java Mon Nov 12 14:22:31 2007
@@ -1,4 +1,5 @@
// Copyright 2006, 2007 The Apache Software Foundation
+// Copyright 2006, 2007 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,23 +15,16 @@
package org.apache.tapestry.ioc.internal.services;
-import static java.lang.String.format;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newConcurrentMap;
+import org.apache.tapestry.ioc.services.*;
+import org.apache.tapestry.ioc.util.BodyBuilder;
+import static java.lang.String.format;
import java.lang.reflect.Constructor;
import java.lang.reflect.Modifier;
import java.util.List;
import java.util.Map;
-import org.apache.tapestry.ioc.services.Builtin;
-import org.apache.tapestry.ioc.services.ChainBuilder;
-import org.apache.tapestry.ioc.services.ClassFab;
-import org.apache.tapestry.ioc.services.ClassFabUtils;
-import org.apache.tapestry.ioc.services.ClassFactory;
-import org.apache.tapestry.ioc.services.MethodIterator;
-import org.apache.tapestry.ioc.services.MethodSignature;
-import org.apache.tapestry.ioc.util.BodyBuilder;
-
public class ChainBuilderImpl implements ChainBuilder
{
private final ClassFactory _classFactory;
@@ -114,7 +108,7 @@
builder.addln("_commands = (%s[]) $1.toArray(new %<s[0]);", commandInterface.getName());
cf.addConstructor(new Class[]
- { List.class }, null, builder.toString());
+ {List.class}, null, builder.toString());
}
@SuppressWarnings("unchecked")
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ClassFabImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ClassFabImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ClassFabImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ClassFabImpl.java Mon Nov 12 14:22:31 2007
@@ -14,22 +14,9 @@
package org.apache.tapestry.ioc.internal.services;
-import static java.lang.String.format;
+import javassist.*;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newMap;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newSet;
-
-import java.lang.reflect.Modifier;
-import java.util.Formatter;
-import java.util.Map;
-import java.util.Set;
-
-import javassist.CannotCompileException;
-import javassist.CtClass;
-import javassist.CtConstructor;
-import javassist.CtField;
-import javassist.CtMethod;
-import javassist.NotFoundException;
-
import org.apache.tapestry.ioc.internal.util.Defense;
import org.apache.tapestry.ioc.internal.util.InternalUtils;
import org.apache.tapestry.ioc.services.ClassFab;
@@ -38,6 +25,12 @@
import org.apache.tapestry.ioc.services.MethodSignature;
import org.slf4j.Logger;
+import static java.lang.String.format;
+import java.lang.reflect.Modifier;
+import java.util.Formatter;
+import java.util.Map;
+import java.util.Set;
+
/**
* Implementation of {@link org.apache.tapestry.ioc.services.ClassFab}. Hides, as much as possible,
* the underlying library (Javassist).
@@ -72,7 +65,7 @@
/**
* Returns a representation of the fabricated class, including inheritance, fields,
* constructors, methods and method bodies.
- *
+ *
* @since 1.1
*/
@Override
@@ -164,7 +157,7 @@
}
public void proxyMethodsToDelegate(Class serviceInterface, String delegateExpression,
- String toString)
+ String toString)
{
_lock.check();
@@ -298,16 +291,13 @@
/**
* Adds a listing of method (or constructor) parameters and thrown exceptions, and the body, to
* the description
- *
- * @param parameterTypes
- * types of method parameters, or null
- * @param exceptions
- * types of throw exceptions, or null
- * @param body
- * body of method or constructor
+ *
+ * @param parameterTypes types of method parameters, or null
+ * @param exceptions types of throw exceptions, or null
+ * @param body body of method or constructor
*/
private void addMethodDetailsToDescription(Class[] parameterTypes, Class[] exceptions,
- String body)
+ String body)
{
_description.append("(");
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ClassFactoryClassPool.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ClassFactoryClassPool.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ClassFactoryClassPool.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ClassFactoryClassPool.java Mon Nov 12 14:22:31 2007
@@ -14,20 +14,14 @@
package org.apache.tapestry.ioc.internal.services;
+import javassist.*;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newMap;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newSet;
+import org.apache.tapestry.ioc.services.ClassFabUtils;
import java.util.Map;
import java.util.Set;
-import javassist.ClassPath;
-import javassist.ClassPool;
-import javassist.CtClass;
-import javassist.LoaderClassPath;
-import javassist.NotFoundException;
-
-import org.apache.tapestry.ioc.services.ClassFabUtils;
-
/**
* Used to ensure that {@link javassist.ClassPool#appendClassPath(javassist.ClassPath)} is invoked
* within a synchronized lock, and also handles tricky class loading issues (caused by the creation
@@ -54,9 +48,8 @@
* {@link CtClass}. This is used to filter out Hibernate-style proxies (created as subclasses
* of oridnary classes). This will automatically add the class' classLoader to the pool's class
* path.
- *
- * @param clazz
- * class to import
+ *
+ * @param clazz class to import
* @return clazz, or a super-class of clazz
*/
public Class importClass(Class clazz)
@@ -84,11 +77,10 @@
/**
* Convienience method for adding to the ClassPath for a particular class loader.
- * <p>
- *
- * @param loader
- * the class loader to add (derived from a loaded class, and may be null for some
- * system classes)
+ * <p/>
+ *
+ * @param loader the class loader to add (derived from a loaded class, and may be null for some
+ * system classes)
*/
public synchronized void addClassLoaderIfNeeded(ClassLoader loader)
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ClassFactoryImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ClassFactoryImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ClassFactoryImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ClassFactoryImpl.java Mon Nov 12 14:22:31 2007
@@ -14,16 +14,11 @@
package org.apache.tapestry.ioc.internal.services;
-import static org.apache.tapestry.ioc.internal.util.Defense.notNull;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-
import javassist.CtClass;
import javassist.CtConstructor;
import javassist.CtMethod;
-
import org.apache.tapestry.ioc.Location;
+import static org.apache.tapestry.ioc.internal.util.Defense.notNull;
import org.apache.tapestry.ioc.internal.util.InternalUtils;
import org.apache.tapestry.ioc.services.ClassFab;
import org.apache.tapestry.ioc.services.ClassFabUtils;
@@ -31,6 +26,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
/**
* Implementation of {@link org.apache.tapestry.ioc.services.ClassFactory}.
*/
@@ -57,13 +55,17 @@
this(Thread.currentThread().getContextClassLoader());
}
- /** Main constructor where a specific class loader and log is provided. */
+ /**
+ * Main constructor where a specific class loader and log is provided.
+ */
public ClassFactoryImpl(ClassLoader classLoader, Logger log)
{
this(classLoader, new ClassFactoryClassPool(classLoader), log);
}
- /** Special constructor used when the class pool is provided externally. */
+ /**
+ * Special constructor used when the class pool is provided externally.
+ */
public ClassFactoryImpl(ClassLoader classLoader, ClassFactoryClassPool pool, Logger logger)
{
_loader = classLoader;
@@ -101,7 +103,7 @@
catch (Exception ex)
{
throw new RuntimeException(ServiceMessages.unableToCreateClass(name, superClass, ex),
- ex);
+ ex);
}
}
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ClassPropertyAdapterImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ClassPropertyAdapterImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ClassPropertyAdapterImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ClassPropertyAdapterImpl.java Mon Nov 12 14:22:31 2007
@@ -15,14 +15,13 @@
package org.apache.tapestry.ioc.internal.services;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newCaseInsensitiveMap;
+import org.apache.tapestry.ioc.internal.util.InternalUtils;
+import org.apache.tapestry.ioc.services.ClassPropertyAdapter;
+import org.apache.tapestry.ioc.services.PropertyAdapter;
import java.beans.PropertyDescriptor;
import java.util.List;
import java.util.Map;
-
-import org.apache.tapestry.ioc.internal.util.InternalUtils;
-import org.apache.tapestry.ioc.services.ClassPropertyAdapter;
-import org.apache.tapestry.ioc.services.PropertyAdapter;
public class ClassPropertyAdapterImpl implements ClassPropertyAdapter
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/CompoundCoercion.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/CompoundCoercion.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/CompoundCoercion.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/CompoundCoercion.java Mon Nov 12 14:22:31 2007
@@ -18,13 +18,13 @@
/**
* Combines two coercions to create a coercsion through an intermediate type.
- *
+ *
* @param <S>
- * The source (input) type
+ * The source (input) type
* @param <I>
- * The intermediate type
+ * The intermediate type
* @param <T>
- * The target (output) type
+ * The target (output) type
*/
public class CompoundCoercion<S, I, T> implements Coercion<S, T>
{
@@ -44,7 +44,7 @@
// the second operation (I --> T).
I intermediate = _op1.coerce(input);
-
+
return _op2.coerce(intermediate);
}
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/CtClassSource.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/CtClassSource.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/CtClassSource.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/CtClassSource.java Mon Nov 12 14:22:31 2007
@@ -14,12 +14,11 @@
package org.apache.tapestry.ioc.internal.services;
-import java.security.ProtectionDomain;
-
import javassist.CtClass;
import javassist.NotFoundException;
-
import org.apache.tapestry.ioc.services.ClassFabUtils;
+
+import java.security.ProtectionDomain;
/**
* Wrapper around Javassist's {@link javassist.ClassPool} that manages the creation of new instances
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/DefaultImplementationBuilderImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/DefaultImplementationBuilderImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/DefaultImplementationBuilderImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/DefaultImplementationBuilderImpl.java Mon Nov 12 14:22:31 2007
@@ -14,20 +14,14 @@
package org.apache.tapestry.ioc.internal.services;
-import static java.lang.String.format;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newConcurrentMap;
+import org.apache.tapestry.ioc.services.*;
+import static java.lang.String.format;
import java.util.Map;
-import org.apache.tapestry.ioc.services.Builtin;
-import org.apache.tapestry.ioc.services.ClassFab;
-import org.apache.tapestry.ioc.services.ClassFactory;
-import org.apache.tapestry.ioc.services.DefaultImplementationBuilder;
-import org.apache.tapestry.ioc.services.MethodIterator;
-import org.apache.tapestry.ioc.services.MethodSignature;
-
/**
- *
+ *
*/
public class DefaultImplementationBuilderImpl implements DefaultImplementationBuilder
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionAnalysisImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionAnalysisImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionAnalysisImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionAnalysisImpl.java Mon Nov 12 14:22:31 2007
@@ -1,28 +1,27 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
package org.apache.tapestry.ioc.internal.services;
-import static java.util.Collections.unmodifiableList;
-
-import java.util.List;
-
-import org.apache.tapestry.ioc.services.ExceptionAnalysis;
-import org.apache.tapestry.ioc.services.ExceptionInfo;
+import org.apache.tapestry.ioc.services.ExceptionAnalysis;
+import org.apache.tapestry.ioc.services.ExceptionInfo;
+
+import static java.util.Collections.unmodifiableList;
+import java.util.List;
/**
- *
+ *
*/
public class ExceptionAnalysisImpl implements ExceptionAnalysis
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionAnalyzerImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionAnalyzerImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionAnalyzerImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionAnalyzerImpl.java Mon Nov 12 14:22:31 2007
@@ -14,22 +14,15 @@
package org.apache.tapestry.ioc.internal.services;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newMap;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newSet;
+import org.apache.tapestry.ioc.internal.util.CollectionFactory;
+import static org.apache.tapestry.ioc.internal.util.CollectionFactory.*;
+import org.apache.tapestry.ioc.services.*;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.apache.tapestry.ioc.internal.util.CollectionFactory;
-import org.apache.tapestry.ioc.services.ClassPropertyAdapter;
-import org.apache.tapestry.ioc.services.ExceptionAnalysis;
-import org.apache.tapestry.ioc.services.ExceptionAnalyzer;
-import org.apache.tapestry.ioc.services.ExceptionInfo;
-import org.apache.tapestry.ioc.services.PropertyAccess;
-
public class ExceptionAnalyzerImpl implements ExceptionAnalyzer
{
private final PropertyAccess _propertyAccess;
@@ -73,7 +66,7 @@
* includes: an exception message not present in the containing exception or a property value
* not present in the containing exception. Also the first exception is always valued and the
* last exception (with the stack trace) is valued.
- *
+ *
* @param previousInfo
* @param info
* @return
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionInfoImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionInfoImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionInfoImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionInfoImpl.java Mon Nov 12 14:22:31 2007
@@ -14,13 +14,12 @@
package org.apache.tapestry.ioc.internal.services;
-import static java.util.Collections.unmodifiableList;
+import org.apache.tapestry.ioc.internal.util.InternalUtils;
+import org.apache.tapestry.ioc.services.ExceptionInfo;
+import static java.util.Collections.unmodifiableList;
import java.util.List;
import java.util.Map;
-
-import org.apache.tapestry.ioc.internal.util.InternalUtils;
-import org.apache.tapestry.ioc.services.ExceptionInfo;
public class ExceptionInfoImpl implements ExceptionInfo
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionTrackerImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionTrackerImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionTrackerImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/ExceptionTrackerImpl.java Mon Nov 12 14:22:31 2007
@@ -15,12 +15,11 @@
package org.apache.tapestry.ioc.internal.services;
import static org.apache.tapestry.ioc.IOCConstants.PERTHREAD_SCOPE;
+import org.apache.tapestry.ioc.annotations.Scope;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newSet;
+import org.apache.tapestry.ioc.services.ExceptionTracker;
import java.util.Set;
-
-import org.apache.tapestry.ioc.annotations.Scope;
-import org.apache.tapestry.ioc.services.ExceptionTracker;
@Scope(PERTHREAD_SCOPE)
public class ExceptionTrackerImpl implements ExceptionTracker
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/JustInTimeObjectCreator.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/JustInTimeObjectCreator.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/JustInTimeObjectCreator.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/JustInTimeObjectCreator.java Mon Nov 12 14:22:31 2007
@@ -28,7 +28,7 @@
* application startup), and orderly shutdown of proxies.
*/
public class JustInTimeObjectCreator implements ObjectCreator, EagerLoadServiceProxy,
- RegistryShutdownListener
+ RegistryShutdownListener
{
private final ServiceActivityTracker _tracker;
@@ -41,7 +41,7 @@
private final String _serviceId;
public JustInTimeObjectCreator(ServiceActivityTracker tracker, ObjectCreator creator,
- String serviceId)
+ String serviceId)
{
_tracker = tracker;
_creator = creator;
@@ -51,9 +51,8 @@
/**
* Checks to see if the proxy has been shutdown, then invokes
* {@link ObjectCreator#createObject()} if it has not already done so.
- *
- * @throws IllegalStateException
- * if the registry has been shutdown
+ *
+ * @throws IllegalStateException if the registry has been shutdown
*/
public synchronized Object createObject()
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/LoggingDecoratorImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/LoggingDecoratorImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/LoggingDecoratorImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/LoggingDecoratorImpl.java Mon Nov 12 14:22:31 2007
@@ -14,23 +14,16 @@
package org.apache.tapestry.ioc.internal.services;
-import static java.lang.String.format;
+import org.apache.tapestry.ioc.services.*;
import static org.apache.tapestry.ioc.services.ClassFabUtils.toJavaClassName;
+import org.apache.tapestry.ioc.util.BodyBuilder;
+import org.slf4j.Logger;
+import static java.lang.String.format;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
-import org.apache.tapestry.ioc.services.Builtin;
-import org.apache.tapestry.ioc.services.ClassFab;
-import org.apache.tapestry.ioc.services.ClassFactory;
-import org.apache.tapestry.ioc.services.ExceptionTracker;
-import org.apache.tapestry.ioc.services.LoggingDecorator;
-import org.apache.tapestry.ioc.services.MethodIterator;
-import org.apache.tapestry.ioc.services.MethodSignature;
-import org.apache.tapestry.ioc.util.BodyBuilder;
-import org.slf4j.Logger;
-
public class LoggingDecoratorImpl implements LoggingDecorator
{
private final ClassFactory _classFactory;
@@ -40,7 +33,7 @@
public LoggingDecoratorImpl(@Builtin
ClassFactory classFactory,
- ExceptionTracker exceptionTracker)
+ ExceptionTracker exceptionTracker)
{
_classFactory = classFactory;
_exceptionTracker = exceptionTracker;
@@ -83,7 +76,7 @@
cf.addField("_logger", Modifier.PRIVATE | Modifier.FINAL, ServiceLogger.class);
cf.addConstructor(new Class[]
- { serviceInterface, ServiceLogger.class }, null, "{ _delegate = $1; _logger = $2; }");
+ {serviceInterface, ServiceLogger.class}, null, "{ _delegate = $1; _logger = $2; }");
addMethods(cf, serviceInterface, serviceId);
@@ -154,7 +147,7 @@
}
private void addExceptionHandler(BodyBuilder builder, String quotedMethodName,
- Class exceptionType)
+ Class exceptionType)
{
builder.addln("catch (%s ex)", exceptionType.getName());
builder.begin();
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/MapSymbolProvider.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/MapSymbolProvider.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/MapSymbolProvider.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/MapSymbolProvider.java Mon Nov 12 14:22:31 2007
@@ -14,9 +14,9 @@
package org.apache.tapestry.ioc.internal.services;
-import java.util.Map;
-
import org.apache.tapestry.ioc.services.SymbolProvider;
+
+import java.util.Map;
/**
* Provides symbol values from a Map of symbol names and symbol values (typically provided by a
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/MasterObjectProviderImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/MasterObjectProviderImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/MasterObjectProviderImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/MasterObjectProviderImpl.java Mon Nov 12 14:22:31 2007
@@ -14,13 +14,13 @@
package org.apache.tapestry.ioc.internal.services;
-import java.util.List;
-
import org.apache.tapestry.ioc.AnnotationProvider;
import org.apache.tapestry.ioc.ObjectLocator;
import org.apache.tapestry.ioc.ObjectProvider;
import org.apache.tapestry.services.MasterObjectProvider;
+import java.util.List;
+
public class MasterObjectProviderImpl implements MasterObjectProvider
{
private final List<ObjectProvider> _configuration;
@@ -31,7 +31,7 @@
}
public <T> T provide(Class<T> objectType, AnnotationProvider annotationProvider,
- ObjectLocator locator, boolean required)
+ ObjectLocator locator, boolean required)
{
for (ObjectProvider provider : _configuration)
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PerThreadServiceCreator.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PerThreadServiceCreator.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PerThreadServiceCreator.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PerThreadServiceCreator.java Mon Nov 12 14:22:31 2007
@@ -1,33 +1,31 @@
-// Copyright 2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
+// Copyright 2006 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
/**
- *
+ *
*/
package org.apache.tapestry.ioc.internal.services;
-import org.apache.tapestry.ioc.ObjectCreator;
-import org.apache.tapestry.ioc.services.ThreadCleanupHub;
-import org.apache.tapestry.ioc.services.ThreadCleanupListener;
+import org.apache.tapestry.ioc.ObjectCreator;
+import org.apache.tapestry.ioc.services.ThreadCleanupHub;
+import org.apache.tapestry.ioc.services.ThreadCleanupListener;
/**
* Provides per-thread implementations of services, along with end-of-request thread cleanup.
- *
- *
*/
public class PerThreadServiceCreator extends ThreadLocal implements ThreadCleanupListener,
- ObjectCreator
+ ObjectCreator
{
private final ThreadCleanupHub _threadCleanupHub;
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PerThreadServiceLifecycle.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PerThreadServiceLifecycle.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PerThreadServiceLifecycle.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PerThreadServiceLifecycle.java Mon Nov 12 14:22:31 2007
@@ -14,28 +14,23 @@
package org.apache.tapestry.ioc.internal.services;
-import static java.lang.String.format;
+import org.apache.tapestry.ioc.ObjectCreator;
+import org.apache.tapestry.ioc.ServiceLifecycle;
+import org.apache.tapestry.ioc.ServiceResources;
+import org.apache.tapestry.ioc.services.*;
+import static java.lang.String.format;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Modifier;
-import org.apache.tapestry.ioc.ObjectCreator;
-import org.apache.tapestry.ioc.ServiceLifecycle;
-import org.apache.tapestry.ioc.ServiceResources;
-import org.apache.tapestry.ioc.services.Builtin;
-import org.apache.tapestry.ioc.services.ClassFab;
-import org.apache.tapestry.ioc.services.ClassFactory;
-import org.apache.tapestry.ioc.services.MethodSignature;
-import org.apache.tapestry.ioc.services.ThreadCleanupHub;
-
/**
* Allows a service to exist "per thread" (in each thread). This involves an inner proxy, with a
* ThreadLocal whose initial value is derived from a {@link org.apache.tapestry.ioc.ObjectCreator}.
* Method invocations are delegated to the per-thread service instance. The proxy also implements
* {@link org.apache.tapestry.ioc.services.ThreadCleanupListener} so that it can discard the
* per-thread implementation.
- * <p>
+ * <p/>
* This scheme ensures that, although the service builder method will be invoked many times over the
* life of the application, the service decoration process occurs only once. The final calling chain
* is: Service Proxy --> Decorator(s) --> PerThread Proxy --> (per thread) instance.
@@ -50,8 +45,8 @@
public PerThreadServiceLifecycle(ThreadCleanupHub threadCleanupHub,
- @Builtin
- ClassFactory classFactory)
+ @Builtin
+ ClassFactory classFactory)
{
_threadCleanupHub = threadCleanupHub;
_classFactory = classFactory;
@@ -90,12 +85,12 @@
// Constructor takes a ServiceCreator
cf.addConstructor(new Class[]
- { ObjectCreator.class }, null, "_creator = $1;");
+ {ObjectCreator.class}, null, "_creator = $1;");
String body = format("return (%s) _creator.createObject();", serviceInterface.getName());
MethodSignature sig = new MethodSignature(serviceInterface, PER_THREAD_METHOD_NAME, null,
- null);
+ null);
cf.addMethod(Modifier.PRIVATE, sig, body);
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PipelineBuilderImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PipelineBuilderImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PipelineBuilderImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PipelineBuilderImpl.java Mon Nov 12 14:22:31 2007
@@ -14,14 +14,14 @@
package org.apache.tapestry.ioc.internal.services;
-import java.util.List;
-
import org.apache.tapestry.ioc.services.Builtin;
import org.apache.tapestry.ioc.services.ClassFactory;
import org.apache.tapestry.ioc.services.DefaultImplementationBuilder;
import org.apache.tapestry.ioc.services.PipelineBuilder;
import org.slf4j.Logger;
+import java.util.List;
+
public class PipelineBuilderImpl implements PipelineBuilder
{
private final ClassFactory _classFactory;
@@ -31,14 +31,14 @@
public PipelineBuilderImpl(@Builtin
ClassFactory classFactory,
- DefaultImplementationBuilder defaultImplementationBuilder)
+ DefaultImplementationBuilder defaultImplementationBuilder)
{
_classFactory = classFactory;
_defaultImplementationBuilder = defaultImplementationBuilder;
}
public <S, F> S build(Logger log, Class<S> serviceInterface, Class<F> filterInterface,
- List<F> filters)
+ List<F> filters)
{
S terminator = _defaultImplementationBuilder.createDefaultImplementation(serviceInterface);
@@ -46,12 +46,12 @@
}
public <S, F> S build(Logger log, Class<S> serviceInterface, Class<F> filterInterface,
- List<F> filters, S terminator)
+ List<F> filters, S terminator)
{
if (filters.isEmpty()) return terminator;
BridgeBuilder<S, F> bb = new BridgeBuilder<S, F>(log, serviceInterface, filterInterface,
- _classFactory);
+ _classFactory);
// The first bridge will point to the terminator.
// Like service decorators, we work deepest (last)
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PropertyAccessImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PropertyAccessImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PropertyAccessImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PropertyAccessImpl.java Mon Nov 12 14:22:31 2007
@@ -14,9 +14,9 @@
package org.apache.tapestry.ioc.internal.services;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newConcurrentMap;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newLinkedList;
-import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newList;
+import static org.apache.tapestry.ioc.internal.util.CollectionFactory.*;
+import org.apache.tapestry.ioc.services.ClassPropertyAdapter;
+import org.apache.tapestry.ioc.services.PropertyAccess;
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
@@ -26,9 +26,6 @@
import java.util.List;
import java.util.Map;
-import org.apache.tapestry.ioc.services.ClassPropertyAdapter;
-import org.apache.tapestry.ioc.services.PropertyAccess;
-
public class PropertyAccessImpl implements PropertyAccess
{
private final Map<Class, ClassPropertyAdapter> _adapters = newConcurrentMap();
@@ -43,7 +40,9 @@
getAdapter(instance).set(instance, propertyName, value);
}
- /** Clears the cache of adapters and asks the Introspector to clear its cache. */
+ /**
+ * Clears the cache of adapters and asks the Introspector to clear its cache.
+ */
public synchronized void clearCache()
{
_adapters.clear();
@@ -105,7 +104,8 @@
}
private void addPropertiesFromExtendedInterfaces(Class forClass,
- List<PropertyDescriptor> descriptors) throws IntrospectionException
+ List<PropertyDescriptor> descriptors)
+ throws IntrospectionException
{
LinkedList<Class> queue = newLinkedList();
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PropertyAdapterImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PropertyAdapterImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PropertyAdapterImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PropertyAdapterImpl.java Mon Nov 12 14:22:31 2007
@@ -16,14 +16,13 @@
import static org.apache.tapestry.ioc.internal.util.Defense.notBlank;
import static org.apache.tapestry.ioc.internal.util.Defense.notNull;
+import org.apache.tapestry.ioc.services.PropertyAdapter;
import java.beans.PropertyDescriptor;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import org.apache.tapestry.ioc.services.PropertyAdapter;
-
public class PropertyAdapterImpl implements PropertyAdapter
{
private final String _name;
@@ -46,7 +45,7 @@
public PropertyAdapterImpl(PropertyDescriptor descriptor)
{
this(descriptor.getName(), descriptor.getPropertyType(), descriptor.getReadMethod(),
- descriptor.getWriteMethod());
+ descriptor.getWriteMethod());
}
public String getName()
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PropertyShadowBuilderImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PropertyShadowBuilderImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PropertyShadowBuilderImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/PropertyShadowBuilderImpl.java Mon Nov 12 14:22:31 2007
@@ -14,19 +14,12 @@
package org.apache.tapestry.ioc.internal.services;
-import static java.lang.String.format;
+import org.apache.tapestry.ioc.services.*;
+import static java.lang.String.format;
import java.lang.reflect.Constructor;
import java.lang.reflect.Modifier;
-import org.apache.tapestry.ioc.services.Builtin;
-import org.apache.tapestry.ioc.services.ClassFab;
-import org.apache.tapestry.ioc.services.ClassFactory;
-import org.apache.tapestry.ioc.services.MethodSignature;
-import org.apache.tapestry.ioc.services.PropertyAccess;
-import org.apache.tapestry.ioc.services.PropertyAdapter;
-import org.apache.tapestry.ioc.services.PropertyShadowBuilder;
-
public class PropertyShadowBuilderImpl implements PropertyShadowBuilder
{
private final ClassFactory _classFactory;
@@ -36,7 +29,7 @@
public PropertyShadowBuilderImpl(@Builtin
ClassFactory classFactory,
- PropertyAccess propertyAccess)
+ PropertyAccess propertyAccess)
{
_classFactory = classFactory;
_propertyAccess = propertyAccess;
@@ -68,7 +61,7 @@
cf.addField("_source", Modifier.PRIVATE | Modifier.FINAL, sourceClass);
cf.addConstructor(new Class[]
- { sourceClass }, null, "_source = $1;");
+ {sourceClass}, null, "_source = $1;");
String body = format("return _source.%s();", adapter.getReadMethod().getName());
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/RegistryShutdownHubImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/RegistryShutdownHubImpl.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/RegistryShutdownHubImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/RegistryShutdownHubImpl.java Mon Nov 12 14:22:31 2007
@@ -15,14 +15,13 @@
package org.apache.tapestry.ioc.internal.services;
import static org.apache.tapestry.ioc.internal.util.CollectionFactory.newThreadSafeList;
-
-import java.util.List;
-
import org.apache.tapestry.ioc.internal.util.OneShotLock;
import org.apache.tapestry.ioc.services.RegistryShutdownHub;
import org.apache.tapestry.ioc.services.RegistryShutdownListener;
import org.slf4j.Logger;
+import java.util.List;
+
public class RegistryShutdownHubImpl implements RegistryShutdownHub
{
private final OneShotLock _lock = new OneShotLock();
@@ -46,9 +45,8 @@
/**
* Fires the {@link RegistryShutdownListener#registryDidShutdown()} method on each listener. At
* the end, all the listeners are discarded.
- *
- * @param log
- * used if any listener throws an exception
+ *
+ * @param log used if any listener throws an exception
*/
public void fireRegistryDidShutdown()
{
Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/RegistryStartup.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/RegistryStartup.java?rev=594319&r1=594318&r2=594319&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/RegistryStartup.java (original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry/ioc/internal/services/RegistryStartup.java Mon Nov 12 14:22:31 2007
@@ -14,11 +14,11 @@
package org.apache.tapestry.ioc.internal.services;
-import java.util.List;
-
import org.apache.tapestry.ioc.Registry;
import org.apache.tapestry.ioc.internal.util.OneShotLock;
import org.slf4j.Logger;
+
+import java.util.List;
/**
* Startup service for Tapestry IoC: automatically invoked at