[exo-jcr-commits] exo-jcr SVN: r301 - in ws/branches/2.2.x: commons and 22 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Mon Oct 19 10:41:19 EDT 2009
Author: aparfonov
Date: 2009-10-19 10:41:18 -0400 (Mon, 19 Oct 2009)
New Revision: 301
Added:
ws/branches/2.2.x/rest/core/src/test/java/conf/log4j.properties
ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/
ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java
ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/DependencySupplierTest.java
ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/RestInitializerTest.java
Removed:
ws/branches/2.2.x/rest/core/src/test/java/conf/standalone/
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/MethodInvokerFilterComponentPlugin.java
ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/BaseTest.java
Modified:
ws/branches/2.2.x/commons/pom.xml
ws/branches/2.2.x/frameworks/json/pom.xml
ws/branches/2.2.x/pom.xml
ws/branches/2.2.x/rest/core/src/main/java/conf/portal/configuration.xml
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ApplicationContext.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencySupplier.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationContextImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ConstructorDescriptorImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/FieldInjectorImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencySupplier.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/InjectableProvider.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java
ws/branches/2.2.x/rest/ext/src/main/java/conf/portal/configuration.xml
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/MethodOverrideFilter.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/UriNormalizationFilter.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/filter/MethodAccessFilter.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/provider/HierarchicalPropertyEntityProvider.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/provider/XSLTStreamingOutput.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialInputData.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialRequest.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialResponse.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/util/XlinkHref.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/CHECKIN.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/CHECKOUT.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/COPY.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/LOCK.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/MKCOL.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/MOVE.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/OPTIONS.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/ORDERPATCH.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/PROPFIND.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/PROPPATCH.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/REPORT.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/SEARCH.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/UNCHECKOUT.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/UNLOCK.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/VERSIONCONTROL.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/RestInitializer.java
ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/servlet/RestServlet.java
ws/branches/2.2.x/rest/ext/src/test/java/conf/standalone/test-configuration.xml
ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/ext/filter/UriNormalizationFilterTest.java
Log:
EXOJCR-185 : clean dependencies
Modified: ws/branches/2.2.x/commons/pom.xml
===================================================================
--- ws/branches/2.2.x/commons/pom.xml 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/commons/pom.xml 2009-10-19 14:41:18 UTC (rev 301)
@@ -35,7 +35,7 @@
<dependencies>
<dependency>
<groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.common</artifactId>
+ <artifactId>exo.kernel.commons</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.stream</groupId>
@@ -45,5 +45,10 @@
<groupId>stax</groupId>
<artifactId>stax-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
Modified: ws/branches/2.2.x/frameworks/json/pom.xml
===================================================================
--- ws/branches/2.2.x/frameworks/json/pom.xml 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/frameworks/json/pom.xml 2009-10-19 14:41:18 UTC (rev 301)
@@ -35,8 +35,9 @@
<dependencies>
<dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.common</artifactId>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
</dependency>
</dependencies>
Modified: ws/branches/2.2.x/pom.xml
===================================================================
--- ws/branches/2.2.x/pom.xml 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/pom.xml 2009-10-19 14:41:18 UTC (rev 301)
@@ -160,6 +160,11 @@
<artifactId>mail</artifactId>
<version>1.4</version>
</dependency>
+ <dependency>
+ <groupId>net.sf.scannotation</groupId>
+ <artifactId>scannotation</artifactId>
+ <version>1.0.2</version>
+ </dependency>
</dependencies>
</dependencyManagement>
Modified: ws/branches/2.2.x/rest/core/src/main/java/conf/portal/configuration.xml
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/conf/portal/configuration.xml 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/conf/portal/configuration.xml 2009-10-19 14:41:18 UTC (rev 301)
@@ -25,26 +25,6 @@
<type>org.exoplatform.services.rest.impl.RequestHandlerImpl</type>
</component>
<component>
- <type>org.exoplatform.services.rest.impl.RequestDispatcher</type>
+ <type>org.exoplatform.services.rest.impl.ResourceBinderImpl</type>
</component>
- <component>
- <type>org.exoplatform.services.rest.impl.ResourceBinder</type>
- </component>
- <component>
- <type>org.exoplatform.services.rest.impl.provider.JAXBContextResolver</type>
- </component>
- <external-component-plugins>
- <target-component>org.exoplatform.services.rest.impl.provider.JAXBContextResolver</target-component>
- <component-plugin>
- <name>ws.rs.jaxb.context</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.rest.impl.provider.JAXBContextComponentPlugin</type>
- <init-params>
- <value-param>
- <name>wadl.application</name>
- <value>org.exoplatform.services.rest.wadl.research.Application</value>
- </value-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-</configuration>
\ No newline at end of file
+</configuration>
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ApplicationContext.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ApplicationContext.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ApplicationContext.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -82,7 +82,7 @@
GenericContainerResponse getContainerResponse();
- DependencySupplier getDependencyInjector();
+ DependencySupplier getDependencySupplier();
/**
* @return See {@link HttpHeaders}
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencySupplier.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencySupplier.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencySupplier.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -29,7 +29,7 @@
{
/**
- * Get object of <code>type</code>.
+ * Get object that is approach do description <code>parameter</code>.
*
* @param parameter required parameter description
* @return object of required type or null if instance described by
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationContextImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationContextImpl.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationContextImpl.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -255,7 +255,7 @@
/**
* {@inheritDoc}
*/
- public DependencySupplier getDependencyInjector()
+ public DependencySupplier getDependencySupplier()
{
return depInjector;
}
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ConstructorDescriptorImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ConstructorDescriptorImpl.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ConstructorDescriptorImpl.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -244,7 +244,7 @@
// If parameter not has not annotation then get constructor parameter
// from DependencyInjector, this is out of scope JAX-RS specification.
- if (context.getDependencyInjector() == null)
+ if (context.getDependencySupplier() == null)
{
String msg =
"Can't instantiate resource " + resourceClass
@@ -254,7 +254,7 @@
.type(MediaType.TEXT_PLAIN).build());
}
- Object tmp = context.getDependencyInjector().getInstanceOfType(cp);
+ Object tmp = context.getDependencySupplier().getInstanceOfType(cp);
if (tmp == null)
{
String msg =
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/FieldInjectorImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/FieldInjectorImpl.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/FieldInjectorImpl.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -226,9 +226,9 @@
}
else
{
- if (context.getDependencyInjector() != null)
+ if (context.getDependencySupplier() != null)
{
- Object tmp = context.getDependencyInjector().getInstanceOfType(this);
+ Object tmp = context.getDependencySupplier().getInstanceOfType(this);
if (tmp != null)
{
try
@@ -239,8 +239,7 @@
}
catch (Throwable e)
{
- // TODO check exception type
- throw new WebApplicationException(e, Response.status(Response.Status.BAD_REQUEST).build());
+ throw new WebApplicationException(e, Response.status(Response.Status.INTERNAL_SERVER_ERROR).build());
}
}
}
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencySupplier.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencySupplier.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencySupplier.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -19,8 +19,11 @@
package org.exoplatform.services.rest.impl;
import org.exoplatform.services.rest.DependencySupplier;
+import org.exoplatform.services.rest.FieldInjector;
+import org.exoplatform.services.rest.Inject;
import org.exoplatform.services.rest.Parameter;
+import java.lang.annotation.Annotation;
import java.util.HashMap;
/**
@@ -32,8 +35,22 @@
private static final long serialVersionUID = 8212609178539168377L;
+ /**
+ * {@inheritDoc}
+ */
public Object getInstanceOfType(Parameter parameter)
{
+ if (parameter instanceof FieldInjector)
+ {
+ for (Annotation a : parameter.getAnnotations())
+ {
+ // Do not process fields without annotation Inject
+ if (a.annotationType() == Inject.class)
+ {
+ return get(parameter.getParameterClass());
+ }
+ }
+ }
return get(parameter.getParameterClass());
}
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/InjectableProvider.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/InjectableProvider.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/method/InjectableProvider.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -39,8 +39,8 @@
@Override
public Object resolve(Parameter parameter, ApplicationContext context) throws Exception
{
- if (context.getDependencyInjector() != null)
- return context.getDependencyInjector().getInstanceOfType(parameter);
+ if (context.getDependencySupplier() != null)
+ return context.getDependencySupplier().getInstanceOfType(parameter);
return null;
}
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -21,6 +21,8 @@
import org.exoplatform.services.rest.DependencySupplier;
import org.exoplatform.services.rest.RequestHandler;
import org.exoplatform.services.rest.ResourceBinder;
+import org.exoplatform.services.rest.impl.ApplicationDeployer;
+import org.exoplatform.services.rest.impl.ProviderBinder;
import org.exoplatform.services.rest.impl.ResourceBinderImpl;
import org.exoplatform.services.rest.impl.RequestHandlerImpl;
@@ -29,26 +31,34 @@
import javax.ws.rs.core.Application;
/**
+ * Initialize required components of JAX-RS framework and deploy single JAX-RS application.
+ *
* @author <a href="mailto:andrew00x at gmail.com">Andrey Parfonov</a>
* @version $Id$
*/
public class RestInitializedListener implements ServletContextListener
{
+ /**
+ * {@inheritDoc}
+ */
public void contextDestroyed(ServletContextEvent event)
{
}
+ /**
+ * {@inheritDoc}
+ */
public void contextInitialized(ServletContextEvent event)
{
String dependencyInjectorFQN = event.getServletContext().getInitParameter(DependencySupplier.class.getName());
- DependencySupplier dependencyInjector = null;
+ DependencySupplier dependencySupplier = null;
if (dependencyInjectorFQN != null)
{
try
{
Class<?> cl = Thread.currentThread().getContextClassLoader().loadClass(dependencyInjectorFQN.trim());
- dependencyInjector = (DependencySupplier)cl.newInstance();
+ dependencySupplier = (DependencySupplier)cl.newInstance();
}
catch (ClassNotFoundException cnfe)
{
@@ -64,7 +74,9 @@
}
}
- ResourceBinder binder = new ResourceBinderImpl();
+ ResourceBinder resources = new ResourceBinderImpl();
+ ApplicationDeployer deployer = new ApplicationDeployer(resources, ProviderBinder.getInstance());
+
String applicationFQN = event.getServletContext().getInitParameter("javax.ws.rs.Application");
if (applicationFQN != null)
{
@@ -72,7 +84,7 @@
{
Class<?> cl = Thread.currentThread().getContextClassLoader().loadClass(applicationFQN.trim());
Application application = (Application)cl.newInstance();
-// binder.addApplication(application);
+ deployer.deploy(application);
}
catch (ClassNotFoundException cnfe)
{
@@ -88,7 +100,7 @@
}
}
- RequestHandler handler = new RequestHandlerImpl(binder, dependencyInjector);
+ RequestHandler handler = new RequestHandlerImpl(resources, dependencySupplier);
event.getServletContext().setAttribute(RequestHandler.class.getName(), handler);
}
Added: ws/branches/2.2.x/rest/core/src/test/java/conf/log4j.properties
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/conf/log4j.properties (rev 0)
+++ ws/branches/2.2.x/rest/core/src/test/java/conf/log4j.properties 2009-10-19 14:41:18 UTC (rev 301)
@@ -0,0 +1,9 @@
+log4j.rootLogger=INFO, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.threshold=DEBUG
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.File=target/container.log
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n")
\ No newline at end of file
Property changes on: ws/branches/2.2.x/rest/core/src/test/java/conf/log4j.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -18,9 +18,13 @@
*/
package org.exoplatform.services.rest.impl;
+import java.util.Properties;
+
import junit.framework.TestCase;
//import org.exoplatform.container.StandaloneContainer;
+import org.exoplatform.services.log.LogConfigurator;
+import org.exoplatform.services.log.impl.Log4JConfigurator;
import org.exoplatform.services.rest.impl.ApplicationContextImpl;
import org.exoplatform.services.rest.impl.ResourceBinderImpl;
import org.exoplatform.services.rest.impl.ProviderBinder;
@@ -33,8 +37,6 @@
public abstract class BaseTest extends TestCase
{
-// protected StandaloneContainer container;
-
protected ProviderBinder providers;
protected ResourceBinderImpl resources;
@@ -43,51 +45,46 @@
public void setUp() throws Exception
{
-// StandaloneContainer.setConfigurationPath("src/test/java/conf/standalone/test-configuration.xml");
-// container = StandaloneContainer.getInstance();
resources = new ResourceBinderImpl();
requestHandler = new RequestHandlerImpl(resources, new SimpleDependencySupplier());
requestHandler.init();
-
+
// reset providers to be sure it is clean
ProviderBinder.setInstance(new ProviderBinder());
providers = ProviderBinder.getInstance();
- // Set-up context for tests that are not used full request cycle.
- // Usually context is set-up in RequestHandler
-// ApplicationContextImpl.setCurrent(new ApplicationContextImpl(null, null, providers));
+ LogConfigurator lc = new Log4JConfigurator();
+ Properties props = new Properties();
+ props.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("conf/log4j.properties"));
+ lc.configure(props);
}
protected void setContext()
{
ApplicationContextImpl.setCurrent(new ApplicationContextImpl(null, null, providers));
}
-
+
public void tearDown() throws Exception
{
}
public boolean registry(Object resource) throws Exception
{
- // container.registerComponentInstance(resource);
return resources.bind(resource);
}
public boolean registry(Class<?> resourceClass) throws Exception
{
- // container.registerComponentImplementation(resourceClass.getName(), resourceClass);
return resources.bind(resourceClass);
}
public boolean unregistry(Object resource)
{
- // container.unregisterComponentByInstance(resource);
return resources.unbind(resource.getClass());
}
public boolean unregistry(Class<?> resourceClass)
{
- // container.unregisterComponent(resourceClass.getName());
return resources.unbind(resourceClass);
}
Modified: ws/branches/2.2.x/rest/ext/src/main/java/conf/portal/configuration.xml
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/conf/portal/configuration.xml 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/conf/portal/configuration.xml 2009-10-19 14:41:18 UTC (rev 301)
@@ -25,39 +25,11 @@
<type>org.exoplatform.services.rest.impl.RestInitializer</type>
<init-params>
<values-param>
- <name>ws.rs.entity.provider</name>
+ <name>ws.rest.components</name>
<value>org.exoplatform.services.rest.ext.provider.HierarchicalPropertyEntityProvider</value>
-<!-- Add own entity providers here -->
- </values-param>
- <values-param>
- <name>ws.rs.request.filter</name>
<value>org.exoplatform.services.rest.ext.filter.MethodOverrideFilter</value>
-<!-- Add own request filters here -->
+ <value>org.exoplatform.services.rest.ext.method.filter.MethodAccessFilter</value>
</values-param>
- <values-param>
- <name>ws.rs.response.filter</name>
-<!-- Add own response filters here -->
- </values-param>
- <values-param>
- <name>ws.rs.method.filter</name>
- <value>org.exoplatform.services.rest.impl.method.MethodInvokerFilterComponentPlugin</value>
-<!-- Add own method filters here -->
- </values-param>
- <values-param>
- <name>ws.rs.jaxb.context</name>
- <value>org.exoplatform.services.rest.wadl.research.Application</value>
-<!-- Add own jaxb context here -->
- </values-param>
</init-params>
</component>
- <component>
- <type>org.exoplatform.services.rest.impl.RequestHandlerImpl</type>
- </component>
- <component>
- <type>org.exoplatform.services.rest.impl.ExoContainerResourceBinder</type>
- </component>
- <component>
- <type>org.exoplatform.services.rest.impl.ExoContainerDependencyInjector</type>
- </component>
-
</configuration>
\ No newline at end of file
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/MethodOverrideFilter.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/MethodOverrideFilter.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/MethodOverrideFilter.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -19,6 +19,7 @@
package org.exoplatform.services.rest.ext.filter;
import org.exoplatform.services.rest.ExtHttpHeaders;
+import org.exoplatform.services.rest.Filter;
import org.exoplatform.services.rest.GenericContainerRequest;
import org.exoplatform.services.rest.RequestFilter;
@@ -27,8 +28,9 @@
* header.
*
* @author <a href="mailto:andrew00x at gmail.com">Andrey Parfonov</a>
- * @version $Id: $
+ * @version $Id$
*/
+ at Filter
public class MethodOverrideFilter implements RequestFilter
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/MethodOverrideFilter.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/UriNormalizationFilter.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/UriNormalizationFilter.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/UriNormalizationFilter.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.rest.ext.filter;
+import org.exoplatform.services.rest.Filter;
import org.exoplatform.services.rest.GenericContainerRequest;
import org.exoplatform.services.rest.RequestFilter;
@@ -30,8 +31,9 @@
* details see http://www.unix.com.ua/rfc/rfc3986.html#s6.2.2 .
*
* @author <a href="mailto:andrew00x at gmail.com">Andrey Parfonov</a>
- * @version $Id: $
+ * @version $Id$
*/
+ at Filter
public final class UriNormalizationFilter implements RequestFilter
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/filter/UriNormalizationFilter.java
___________________________________________________________________
Name: svn:keywords
+ Id
Deleted: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/MethodInvokerFilterComponentPlugin.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/MethodInvokerFilterComponentPlugin.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/MethodInvokerFilterComponentPlugin.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.rest.ext.method;
-
-import org.exoplatform.container.component.BaseComponentPlugin;
-import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.container.xml.ValueParam;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.services.rest.RequestHandler;
-import org.exoplatform.services.rest.method.MethodInvokerFilter;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-/**
- * For injection {@link MethodInvokerFilter} in {@link RequestHandler} at
- * startup.
- *
- * @author <a href="mailto:andrew00x at gmail.com">Andrey Parfonov</a>
- * @version $Id: $
- */
-public class MethodInvokerFilterComponentPlugin extends BaseComponentPlugin
-{
-
- /**
- * Logger.
- */
- private static final Log LOG = ExoLogger.getLogger(MethodInvokerFilterComponentPlugin.class.getName());
-
- /**
- * List of {@link MethodInvokerFilter}.
- */
- private Set<Class<? extends MethodInvokerFilter>> mifs = new HashSet<Class<? extends MethodInvokerFilter>>();
-
- /**
- * @param params initialize parameters from configuration
- * @see InitParams
- */
- @SuppressWarnings("unchecked")
- public MethodInvokerFilterComponentPlugin(InitParams params)
- {
- if (params != null)
- {
- Iterator<ValueParam> i = params.getValueParamIterator();
- while (i.hasNext())
- {
- ValueParam v = i.next();
- try
- {
- mifs.add((Class<? extends MethodInvokerFilter>)Class.forName(v.getValue()));
- }
- catch (ClassNotFoundException e)
- {
- LOG.error("Failed load class " + v.getValue(), e);
- }
- }
- }
- }
-
- /**
- * @return get collection of classes MethodInvokerFilter supplied from
- * configuration
- */
- public Set<Class<? extends MethodInvokerFilter>> getFilters()
- {
- return mifs;
- }
-
-}
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/filter/MethodAccessFilter.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/filter/MethodAccessFilter.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/filter/MethodAccessFilter.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.rest.ext.method.filter;
+import org.exoplatform.services.rest.Filter;
import org.exoplatform.services.rest.impl.ApplicationContextImpl;
import org.exoplatform.services.rest.method.MethodInvokerFilter;
import org.exoplatform.services.rest.resource.GenericMethodResource;
@@ -36,8 +37,9 @@
* use JSR-250 security common annotations. See also https://jsr250.dev.java.net .
*
* @author <a href="mailto:andrew00x at gmail.com">Andrey Parfonov</a>
- * @version $Id: $
+ * @version $Id$
*/
+ at Filter
public class MethodAccessFilter implements MethodInvokerFilter
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/method/filter/MethodAccessFilter.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/provider/HierarchicalPropertyEntityProvider.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/provider/HierarchicalPropertyEntityProvider.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/provider/HierarchicalPropertyEntityProvider.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -34,6 +34,7 @@
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.ext.Provider;
import javax.xml.namespace.QName;
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLEventReader;
@@ -53,6 +54,7 @@
* @author <a href="dkatayev at gmail.com">Dmytro Katayev</a>
* @version $Id: HierarchicalPropertyEntityProvider.java
*/
+ at Provider
public class HierarchicalPropertyEntityProvider implements EntityProvider<HierarchicalProperty>
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/provider/HierarchicalPropertyEntityProvider.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/provider/XSLTStreamingOutput.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialInputData.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialInputData.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialInputData.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -34,7 +34,7 @@
* SerialInputData is useful for transfer data represented by stream via RMI.
*
* @author <a href="mailto:andrew00x at gmail.com">Andrey Parfonov</a>
- * @version $Id: $
+ * @version $Id$
*/
public class SerialInputData implements Serializable
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialInputData.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialRequest.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialRequest.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialRequest.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -36,7 +36,7 @@
* {@link RequestHandler}.
*
* @author <a href="mailto:andrew00x at gmail.com">Andrey Parfonov</a>
- * @version $Id: $
+ * @version $Id$
*/
public class SerialRequest implements Serializable
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialRequest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialResponse.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialResponse.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialResponse.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -31,7 +31,7 @@
*
* @see SerialRequest
* @author <a href="mailto:andrew00x at gmail.com">Andrey Parfonov</a>
- * @version $Id: $
+ * @version $Id$
*/
public class SerialResponse implements Serializable
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/transport/SerialResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/util/XlinkHref.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/util/XlinkHref.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/util/XlinkHref.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -25,7 +25,7 @@
* of DOM structure.<br/>
*
* @author Gennady Azarenkov
- * @version $Id: $
+ * @version $Id$
*/
public class XlinkHref
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/util/XlinkHref.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/CHECKIN.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/CHECKOUT.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/COPY.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/LOCK.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/MKCOL.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/MOVE.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/OPTIONS.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/ORDERPATCH.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/PROPFIND.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/PROPPATCH.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/REPORT.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/SEARCH.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/UNCHECKOUT.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/UNLOCK.java
___________________________________________________________________
Name: svn:keywords
+ Id
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/ext/webdav/method/VERSIONCONTROL.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/RestInitializer.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/RestInitializer.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/impl/RestInitializer.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -24,11 +24,14 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.services.rest.DependencySupplier;
+import org.exoplatform.services.rest.FieldInjector;
+import org.exoplatform.services.rest.Inject;
import org.exoplatform.services.rest.Parameter;
import org.exoplatform.services.rest.ResourceBinder;
import org.exoplatform.services.rest.resource.ResourceContainer;
import org.picocontainer.Startable;
+import java.lang.annotation.Annotation;
import java.util.List;
import javax.ws.rs.core.Application;
@@ -49,7 +52,6 @@
public RestInitializer(ResourceBinder resources, InitParams initParams, ExoContainerContext containerContext)
{
super(resources, ProviderBinder.getInstance());
- ExoContainer container = containerContext.getContainer();
if (initParams != null)
{
for (Object cl : initParams.getValuesParam("ws.rest.components").getValues())
@@ -64,6 +66,8 @@
}
}
}
+
+ ExoContainer container = containerContext.getContainer();
List<Application> applications = container.getComponentInstancesOfType(Application.class);
for (Application a : applications)
{
@@ -75,15 +79,37 @@
}
}
+ /**
+ * {@inheritDoc}
+ */
public Object getInstanceOfType(Parameter parameter)
{
- return null;
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+
+ if (parameter instanceof FieldInjector)
+ {
+ for (Annotation a : parameter.getAnnotations())
+ {
+ // Do not process fields without annotation Inject
+ if (a.annotationType() == Inject.class)
+ {
+ return container.getComponentInstanceOfType(parameter.getParameterClass());
+ }
+ }
+ }
+ return container.getComponentInstanceOfType(parameter.getParameterClass());
}
+ /**
+ * {@inheritDoc}
+ */
public void start()
{
}
+ /**
+ * {@inheritDoc}
+ */
public void stop()
{
}
Modified: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/servlet/RestServlet.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/servlet/RestServlet.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/servlet/RestServlet.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -39,7 +39,7 @@
* This servlet is front-end for the REST engine.
*
* @author <a href="mailto:andrew00x at gmail.com">Andrey Parfonov</a>
- * @version $Id: $
+ * @version $Id$
*/
public class RestServlet extends AbstractHttpServlet implements Connector
{
Property changes on: ws/branches/2.2.x/rest/ext/src/main/java/org/exoplatform/services/rest/servlet/RestServlet.java
___________________________________________________________________
Name: svn:keywords
+ Id
Modified: ws/branches/2.2.x/rest/ext/src/test/java/conf/standalone/test-configuration.xml
===================================================================
--- ws/branches/2.2.x/rest/ext/src/test/java/conf/standalone/test-configuration.xml 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/test/java/conf/standalone/test-configuration.xml 2009-10-19 14:41:18 UTC (rev 301)
@@ -1,42 +1,71 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
- <!--
+<!--
- Copyright (C) 2009 eXo Platform SAS. This is free software; you can
- redistribute it and/or modify it under the terms of the GNU Lesser
- General Public License as published by the Free Software Foundation;
- either version 2.1 of the License, or (at your option) any later
- version. This software is distributed in the hope that it will be
- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details. You should have
- received a copy of the GNU Lesser General Public License along with
- this software; if not, write to the Free Software Foundation, Inc., 51
- Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- site: http://www.fsf.org.
- -->
-<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
- xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ Copyright (C) 2009 eXo Platform SAS.
- <component>
- <type>org.exoplatform.services.rest.impl.RestInitializer</type>
- <init-params>
- <values-param>
- <name>ws.rest.components</name>
- <value>org.exoplatform.services.rest.ext.provider.HierarchicalPropertyEntityProvider</value>
- <value>org.exoplatform.services.rest.ext.filter.MethodOverrideFilter</value>
- <value>org.exoplatform.services.rest.impl.method.MethodInvokerFilterComponentPlugin</value>
- </values-param>
- </init-params>
- </component>
- <component>
- <type>org.exoplatform.services.rest.impl.RequestHandlerImpl</type>
- </component>
- <component>
- <type>org.exoplatform.services.rest.impl.BaseResourceBinder</type>
- </component>
- <component>
- <type>org.exoplatform.services.rest.impl.ExoContainerDependencyInjector</type>
- </component>
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+
+-->
+
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+ xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.slf4j.Logger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout" />
+ <property name="log4j.appender.stdout" value="org.apache.log4j.ConsoleAppender" />
+ <property name="log4j.appender.stdout.threshold" value="DEBUG" />
+ <property name="log4j.appender.stdout.layout" value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.stdout.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
+ <property name="log4j.appender.file" value="org.apache.log4j.FileAppender" />
+ <property name="log4j.appender.file.File" value="target/container.log" />
+ <property name="log4j.appender.file.layout" value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.file.layout.ConversionPattern" value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
+ </properties-param>
+ </init-params>
+ </component>
+ <component>
+ <type>org.exoplatform.services.rest.impl.RestInitializer</type>
+ <init-params>
+ <values-param>
+ <name>ws.rest.components</name>
+ <value>org.exoplatform.services.rest.ext.provider.HierarchicalPropertyEntityProvider</value>
+ <value>org.exoplatform.services.rest.ext.filter.MethodOverrideFilter</value>
+ <value>org.exoplatform.services.rest.ext.method.filter.MethodAccessFilter</value>
+ </values-param>
+ </init-params>
+ </component>
+ <component>
+ <type>org.exoplatform.services.rest.impl.RequestHandlerImpl</type>
+ </component>
+ <component>
+ <type>org.exoplatform.services.rest.impl.ResourceBinderImpl</type>
+ </component>
+
</configuration>
\ No newline at end of file
Deleted: ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/BaseTest.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/BaseTest.java 2009-10-19 13:36:47 UTC (rev 300)
+++ ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/BaseTest.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.exoplatform.services.rest;
-
-import org.exoplatform.container.StandaloneContainer;
-
-import junit.framework.TestCase;
-
-/**
- * @author <a href="mailto:andrey.parfonov at exoplatform.com">Andrey Parfonov</a>
- * @version $Id$
- */
-public abstract class BaseTest extends TestCase
-{
-
- protected StandaloneContainer container;
-
- public void setUp() throws Exception
- {
- StandaloneContainer.setConfigurationPath("src/test/java/conf/standalone/test-configuration.xml");
- container = StandaloneContainer.getInstance();
- }
-
-}
Property changes on: ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/ext/filter/UriNormalizationFilterTest.java
___________________________________________________________________
Name: svn:keywords
+ Id
Copied: ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java (from rev 292, ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/BaseTest.java)
===================================================================
--- ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java (rev 0)
+++ ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.rest.impl;
+
+import org.exoplatform.container.StandaloneContainer;
+
+import junit.framework.TestCase;
+
+/**
+ * @author <a href="mailto:andrey.parfonov at exoplatform.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public abstract class BaseTest extends TestCase
+{
+
+ protected StandaloneContainer container;
+
+ public void setUp() throws Exception
+ {
+ StandaloneContainer.setConfigurationPath("src/test/java/conf/standalone/test-configuration.xml");
+ container = StandaloneContainer.getInstance();
+ }
+
+ protected void setContext()
+ {
+ ApplicationContextImpl.setCurrent(new ApplicationContextImpl(null, null, ProviderBinder.getInstance()));
+ }
+
+}
Property changes on: ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/DependencySupplierTest.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/DependencySupplierTest.java (rev 0)
+++ ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/DependencySupplierTest.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.rest.impl;
+
+import java.lang.annotation.Annotation;
+
+import org.exoplatform.services.rest.DependencySupplier;
+import org.exoplatform.services.rest.Parameter;
+
+/**
+ * @author <a href="mailto:andrey.parfonov at exoplatform.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public class DependencySupplierTest extends BaseTest
+{
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ setContext();
+ }
+
+ public static class Component1
+ {
+ // For testing DependencySupplier.
+ }
+
+ public void testDependencySupplier()
+ {
+ DependencySupplier depSupplier =
+ (DependencySupplier)container.getComponentInstanceOfType(DependencySupplier.class);
+ assertNotNull(depSupplier);
+ container.registerComponentInstance(new Component1());
+ Parameter t = new ConstructorParameterImpl(null, new Annotation[0], Component1.class, null, null, false);
+ assertNotNull(depSupplier.getInstanceOfType(t));
+ }
+
+}
Property changes on: ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/DependencySupplierTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/RestInitializerTest.java
===================================================================
--- ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/RestInitializerTest.java (rev 0)
+++ ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/RestInitializerTest.java 2009-10-19 14:41:18 UTC (rev 301)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.exoplatform.services.rest.impl;
+
+import javax.ws.rs.core.MediaType;
+
+import org.exoplatform.common.util.HierarchicalProperty;
+
+/**
+ * @author <a href="mailto:andrey.parfonov at exoplatform.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public class RestInitializerTest extends BaseTest
+{
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ setContext();
+ }
+
+ // Check does we get all additional component specified in configuration.
+ public void testDeployAdditionalComponents()
+ {
+ ProviderBinder providers = ProviderBinder.getInstance();
+ // XXX Able (no NPE) to use null instead "path" because UriPattern
+ // for filters in null and path will be never checked.
+ assertEquals(1, providers.getRequestFilters(null).size());
+ assertEquals(1, providers.getMethodInvokerFilters(null).size());
+ // -----
+ assertNotNull(providers.getMessageBodyReader(HierarchicalProperty.class, null, null,
+ MediaType.APPLICATION_XML_TYPE));
+ }
+
+}
Property changes on: ws/branches/2.2.x/rest/ext/src/test/java/org/exoplatform/services/rest/impl/RestInitializerTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
More information about the exo-jcr-commits
mailing list