You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by ms...@apache.org on 2016/01/18 13:41:29 UTC
[27/35] portals-pluto git commit: Initial integration of bean
processor code
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/2e60a313/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/PortletStateScopedBeanHolder.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/PortletStateScopedBeanHolder.java b/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/PortletStateScopedBeanHolder.java
new file mode 100644
index 0000000..04477a1
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/PortletStateScopedBeanHolder.java
@@ -0,0 +1,241 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.pluto.container.bean.processor;
+
+import java.io.Serializable;
+import java.util.Arrays;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Bean;
+import javax.portlet.PortletRequest;
+import javax.portlet.StateAwareResponse;
+import javax.portlet.annotations.PortletSerializable;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This is a container for PortletStateScoped CDI beans.
+ *
+ * @author Scott Nicklous
+ *
+ */
+public class PortletStateScopedBeanHolder implements Serializable {
+
+ /** Logger. */
+ private static final Logger LOG = LoggerFactory.getLogger(PortletStateScopedBeanHolder.class);
+ private static final boolean isTrace = LOG.isTraceEnabled();
+
+ private static final long serialVersionUID = 6014843414216617217L;
+
+ // The ThreadLocal manages the holders so that there is one holder per thread.
+ private static final ThreadLocal<PortletStateScopedBeanHolder> holders =
+ new ThreadLocal<PortletStateScopedBeanHolder>();
+
+ private class BeanInstance<T> implements Serializable {
+ private static final long serialVersionUID = -4173708394115905180L;
+ CreationalContext<T> crco;
+ T instance;
+ }
+
+ // Each instance of the bean holder gets its own map.
+ // Key: Bean Type, Value: Structure containing CreationalContext and the specific
+ // bean instance.
+ private Map<Contextual<?>, BeanInstance<?>> beans =
+ new ConcurrentHashMap<Contextual<?>, BeanInstance<?>>();
+
+ private final PortletRequest request;
+ private final PortletStateScopedConfig config;
+
+ /**
+ * private constructor
+ */
+ private PortletStateScopedBeanHolder(PortletRequest req, PortletStateScopedConfig config) {
+ this.request = req;
+ this.config = config;
+ }
+
+ /**
+ * Sets the portlet session bean holder in a ThreadLocal object for the given
+ * portlet session. If no bean holder exists in the session, a new one is created.
+ *
+ * @param req The portlet request
+ * @return The portlet state bean holder
+ */
+ public static void setBeanHolder(PortletRequest req, PortletStateScopedConfig config) {
+
+ if (isTrace) {
+ StringBuilder txt = new StringBuilder(80);
+ txt.append("Setting portlet state bean holder.");
+ txt.append(" ThreadId=").append(Thread.currentThread().getId());
+ LOG.trace(txt.toString());
+ }
+
+ PortletStateScopedBeanHolder holder = new PortletStateScopedBeanHolder(req, config);
+ holders.set(holder);
+ }
+
+ /**
+ * Removes the bean holder for the current request. Deletes all beans contained therein.
+ * If response is provided, the beans are deserialized and stored.
+ *
+ * @param resp The response for setting the bean values
+ */
+ public static void removeBeanHolder(StateAwareResponse resp) {
+
+ PortletStateScopedBeanHolder bh = getBeanHolder();
+ bh.removeAll(resp);
+ holders.remove();
+
+ if (isTrace) {
+ StringBuilder txt = new StringBuilder(80);
+ txt.append("Removed portlet state bean holder.");
+ txt.append(" ThreadId=").append(Thread.currentThread().getId());
+ LOG.trace(txt.toString());
+ }
+ }
+
+ /**
+ * Returns the portlet session bean holder that was set for the thread.
+ *
+ * @return
+ */
+ public static PortletStateScopedBeanHolder getBeanHolder() {
+ return holders.get();
+ }
+
+ /**
+ * Returns existing instance of object, or null if no instance exists.
+ *
+ * @param bean The bean type
+ * @return The bean instance
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T getBean(Contextual<T> bean) {
+ BeanInstance<?> bi = beans.get(bean);
+ return (bi == null) ? null : (T) bi.instance;
+ }
+
+ /**
+ * Returns an instance for the contextual type. If no existing bean is available,
+ * a new instance is created.
+ *
+ * @param bean Contextual type (Bean) for which an instance is desired
+ * @return The instance, or null if none exists
+ */
+ @SuppressWarnings("unchecked")
+ public <T> T getBean(Contextual<T> bean, CreationalContext<T> crco) {
+ BeanInstance<?> bi = beans.get(bean);
+
+ if (bi == null) {
+
+ // No bean available, so create one.
+
+ BeanInstance<T> newbi = new BeanInstance<T>();
+ newbi.crco = crco;
+ newbi.instance = bean.create(crco);
+ assert newbi.instance instanceof PortletSerializable;
+ bi = newbi;
+
+ // Determine the parameter name.
+ // initialize the bean with the proper values.
+
+ assert bean instanceof Bean<?>;
+ String parmName = config.getParamName((Bean<?>) bean);
+ String[] vals = request.getRenderParameters().getValues(parmName);
+ if (vals == null) {
+ vals = new String[] {};
+ }
+
+ PortletSerializable thisBean = (PortletSerializable) newbi.instance;
+ thisBean.deserialize(vals);
+ beans.put(bean, newbi);
+
+ if (isTrace) {
+ StringBuilder txt = new StringBuilder(80);
+ txt.append("Created bean: ");
+ txt.append(((Bean<?>) bean).getBeanClass().getSimpleName());
+ txt.append(", Render parameter name: ").append(parmName);
+ txt.append(", Values: ").append(Arrays.toString(vals));
+ LOG.trace(txt.toString());
+ }
+
+ }
+
+ return (T) bi.instance;
+ }
+
+ /**
+ * Removes & destroys the given bean
+ * @param bean
+ */
+ @SuppressWarnings("unchecked")
+ protected <T> void remove(Contextual<T> bean) {
+ BeanInstance<?> bi = beans.get(bean);
+
+ if (isTrace) {
+ StringBuilder txt = new StringBuilder(80);
+ txt.append("Removing portlet state scoped bean: ");
+ if (bean instanceof Bean<?>) {
+ Bean<?> b = (Bean<?>) bean;
+ txt.append(b.getBeanClass().getSimpleName());
+ }
+ if (bi == null) {
+ txt.append(", instance is null.");
+ }
+ LOG.trace(txt.toString());
+ }
+
+ if (bi != null) {
+ beans.remove(bean);
+ bi.crco.release();
+ bean.destroy((T)bi.instance, (CreationalContext<T>)bi.crco);
+ }
+ }
+
+ /**
+ * Remove & destroy all beans. if a response is provided, store the bean state.
+ *
+ * @param resp The state aware response
+ */
+ protected void removeAll(StateAwareResponse resp) {
+ for (Contextual<?> bean : beans.keySet()) {
+ if (resp != null) {
+ PortletSerializable thisBean = (PortletSerializable) beans.get(bean).instance;
+ String[] vals = thisBean.serialize();
+ String pn = config.getParamName((Bean<?>) bean);
+ resp.getRenderParameters().setValues(pn, vals);
+
+ if (isTrace) {
+ StringBuilder txt = new StringBuilder(128);
+ txt.append("Stored parameter for portlet with namespace: ");
+ txt.append(resp.getNamespace());
+ txt.append(", paramName: ").append(pn);
+ txt.append(", Values: ").append(Arrays.toString(vals));
+ LOG.trace(txt.toString());
+ }
+ }
+ remove(bean);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/2e60a313/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/PortletStateScopedConfig.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/PortletStateScopedConfig.java b/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/PortletStateScopedConfig.java
new file mode 100644
index 0000000..b92b2cf
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/PortletStateScopedConfig.java
@@ -0,0 +1,207 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.pluto.container.bean.processor;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.portlet.annotations.PortletStateScoped;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Configuration for PortletStateScoped CDI beans.
+ *
+ * @author Scott Nicklous
+ *
+ */
+public class PortletStateScopedConfig implements Serializable {
+ private static final long serialVersionUID = -5333145344722804837L;
+ private final Logger LOG = LoggerFactory.getLogger(PortletStateScopedConfig.class);
+ private final boolean isDebug = LOG.isDebugEnabled();
+
+
+ // Contains a sorted list of PortletStateScoped annotated class names. The sorted list
+ // is used to generate indexes for the assigned render parameter names.
+ private final List<String> sortedAnnotatedClassNames = new ArrayList<String>();
+
+ // Prefix used when generating render parameter names
+ private static final String RP_PREFIX = "\uFE34";
+
+ // Description for the PortletStateScoped bean
+ private class PSSDescription implements Serializable {
+ private static final long serialVersionUID = 4089751663717085089L;
+ PortletStateScoped pssAnno;
+ String paramName;
+ }
+
+ // Maps the bean contextual to the annotation. The bean contextual is obtained
+ // during the activation process after all beans have been discovered.
+ // Note that synchronization is not needed since the map is only changed during the
+ // bean scanning phase.
+ private final Map<Contextual<?>, PSSDescription> context2Anno =
+ new HashMap<Contextual<?>, PSSDescription>();
+
+ // Maps the bean class to the corresponding annotation. The entries are set
+ // while the extension is processing annotated types.
+ // Note that synchronization is not needed since the map is only changed during the
+ // bean scanning phase.
+ private final Map<Class<?>, PSSDescription> class2Anno =
+ new HashMap<Class<?>, PSSDescription>();
+
+ /**
+ * Called by the CDI extension during the scanning phase to add information about
+ * a <code>{@literal @}PortletStateScoped</code> bean.
+ *
+ * @param beanClass The bean class
+ * @param anno The annotation
+ */
+ public void addAnnotation(Class<?> beanClass, PortletStateScoped anno) {
+ PSSDescription desc = new PSSDescription();
+ desc.pssAnno = anno;
+ class2Anno.put(beanClass, desc);
+ }
+
+ /**
+ * Gets the concrete contextual for the bean and puts it into the context map.
+ * Called after bean discovery during the activation process.
+ * Finishes up the configuration process and provides a debug summary.
+ *
+ * @param bm The bean manager
+ */
+ public void activate(BeanManager bm) {
+
+ // The assigned render parameters are based on the alphabetic order of the PSS bean
+ // class names, so generate such a list.
+
+ for (Class<?> c : class2Anno.keySet()) {
+ sortedAnnotatedClassNames.add(c.getCanonicalName());
+ }
+ Collections.sort(sortedAnnotatedClassNames);
+
+ // Now assign the parameter names. If provided through the annotation, use
+ // that one. Otherwise generate a render parameter name.
+
+ for (Class<?> c : class2Anno.keySet()) {
+ PSSDescription desc = class2Anno.get(c);
+ if (desc.pssAnno.paramName().length() > 0) {
+ desc.paramName = desc.pssAnno.paramName();
+ } else {
+ desc.paramName = RP_PREFIX + sortedAnnotatedClassNames.indexOf(c.getCanonicalName());
+ }
+
+ // Fix up the portlet names if specified by the annotation.
+ // prob not needed desc.portletNames.addAll(Arrays.asList(desc.pssAnno.portletNames()));
+ }
+
+ // Activate the beans
+
+ for (Class<?> cls : class2Anno.keySet()) {
+ Set<Bean<?>> beans = bm.getBeans(cls);
+ Bean<?> bean = bm.resolve(beans);
+ assert bean != null;
+ context2Anno.put(bean, class2Anno.get(cls));
+ }
+
+ // dump configuration data to trace
+
+ if (isDebug) {
+ StringBuilder txt = new StringBuilder(128);
+ txt.append("PortletStateScopedBeanHolder configuration: \n");
+ txt.append("\nAnnotatedBeans: ");
+ txt.append(getConfigAsString());
+ LOG.debug(txt.toString());
+ }
+ }
+
+ /**
+ * Returns the portlet state scoped annotated classes.
+ * <p>
+ * Used for test / validation purposes.
+ *
+ * @return Set of annotated classes
+ */
+ public Set<Class<?>> getBeanClasses() {
+ return class2Anno.keySet();
+ }
+
+ /**
+ * Returns a portlet state scoped bean summary for display
+ *
+ * @return The configuration summary string
+ *
+ */
+ public String getConfigAsString() {
+ StringBuilder txt = new StringBuilder(128);
+ for (Class<?> c : class2Anno.keySet()) {
+ txt.append("\n\tClass: ").append(c.getCanonicalName());
+ PSSDescription desc = class2Anno.get(c);
+ txt.append(", Param name: ").append(desc.paramName);
+ }
+ return txt.toString();
+ }
+
+ /**
+ * Returns the parameter name for the given bean class.
+ *
+ * @param beanClass The bean class
+ * @return The corresponding parameter name
+ */
+ public String getParamName(Class<?> beanClass) {
+ String name = null;
+ for (Contextual<?> b : context2Anno.keySet()) {
+ if (b instanceof Bean) {
+ Bean<?> bean = (Bean<?>)b;
+ if (beanClass.isAssignableFrom(bean.getBeanClass())) {
+ name = context2Anno.get(b).paramName;
+ break;
+ }
+ }
+ }
+ return name;
+ }
+
+ /**
+ * Determines the render parameter name for the given bean.
+ *
+ * @param bean The bean
+ * @return The parameter name
+ */
+ public String getParamName(Bean<?> bean) {
+
+ // retrieve the annotation for the bean. If a parameter name is provided
+ // use it. Otherwise use the class name.
+
+ PSSDescription desc = context2Anno.get(bean);
+ assert desc != null;
+ assert desc.paramName.length() > 0;
+ return desc.paramName;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/2e60a313/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/PortletStateScopedContext.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/PortletStateScopedContext.java b/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/PortletStateScopedContext.java
new file mode 100644
index 0000000..251ebb9
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/PortletStateScopedContext.java
@@ -0,0 +1,87 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.pluto.container.bean.processor;
+
+import java.lang.annotation.Annotation;
+
+import javax.enterprise.context.ContextNotActiveException;
+import javax.enterprise.context.spi.Context;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.portlet.annotations.PortletStateScoped;
+
+/**
+ * This is the Context implementation for the PortletStateScoped custom CDI scope.
+ *
+ * @author nick
+ *
+ */
+public class PortletStateScopedContext implements Context {
+
+ public PortletStateScopedContext() {
+ }
+
+ /* (non-Javadoc)
+ * @see javax.enterprise.context.spi.Context#get(javax.enterprise.context.spi.Contextual)
+ */
+ @Override
+ public <T> T get(Contextual<T> bean) {
+ PortletStateScopedBeanHolder holder = PortletStateScopedBeanHolder.getBeanHolder();
+ if (holder == null) {
+ throw new ContextNotActiveException("The portlet state context is not active.");
+ }
+ return holder.getBean(bean);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.enterprise.context.spi.Context#get(javax.enterprise.context.spi.Contextual, javax.enterprise.context.spi.CreationalContext)
+ */
+ @Override
+ public <T> T get(Contextual<T> bean, CreationalContext<T> crco) {
+ PortletStateScopedBeanHolder holder = PortletStateScopedBeanHolder.getBeanHolder();
+
+ if (holder == null) {
+ throw new ContextNotActiveException("The portlet state context is not active.");
+ }
+
+ // The bean hoder will return an existing bean instance or create a new one
+ // if no existing instance is available.
+ T inst = holder.getBean(bean, crco);
+ return inst;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.enterprise.context.spi.Context#getScope()
+ */
+ @Override
+ public Class<? extends Annotation> getScope() {
+ return PortletStateScoped.class;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.enterprise.context.spi.Context#isActive()
+ */
+ @Override
+ public boolean isActive() {
+ PortletStateScopedBeanHolder holder = PortletStateScopedBeanHolder.getBeanHolder();
+ return (holder != null);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/2e60a313/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/SignatureVariant.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/SignatureVariant.java b/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/SignatureVariant.java
new file mode 100644
index 0000000..2a2faa5
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/SignatureVariant.java
@@ -0,0 +1,65 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.pluto.container.bean.processor;
+
+/**
+ * Enum to identify the signature variant for annotated methods that alloe
+ * multiple method signatures.
+ *
+ * @author Scott Nicklous
+ */
+public enum SignatureVariant {
+
+ /**
+ * The default signature for the method.
+ */
+ DEFAULT,
+
+ /**
+ * Signature variant for HeaderMethod, with return value void and
+ * taking a HeaderRequest and HeaderResponse as arguments.
+ */
+ VOID_HEADERREQ_HEADERRESP,
+
+ /**
+ * Signature variant for RenderMethod, with return value void and
+ * taking a RenderRequest and RenderResponse as arguments.
+ */
+ VOID_RENDERREQ_RENDERRESP,
+
+ /**
+ * Signature variant for ResourceMethod, with return value void and
+ * taking a ResourceRequest and ResourceResponse as arguments.
+ */
+ VOID_RESOURCEREQ_RESOURCERESP,
+
+ /**
+ * Signature variant for render, header, and resource methods, with return
+ * value String and taking no arguments.
+ */
+ STRING_VOID,
+
+ /**
+ * Signature variant for render, header, and resource methods, with return
+ * value void and taking no arguments.
+ */
+ VOID_VOID,
+
+}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/2e60a313/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/URLFactoryImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/URLFactoryImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/URLFactoryImpl.java
new file mode 100644
index 0000000..03a957b
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/URLFactoryImpl.java
@@ -0,0 +1,75 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.pluto.container.bean.processor;
+
+import javax.portlet.ActionURL;
+import javax.portlet.MimeResponse;
+import javax.portlet.MimeResponse.Copy;
+import javax.portlet.PortletResponse;
+import javax.portlet.RenderURL;
+import javax.portlet.ResourceURL;
+import javax.portlet.annotations.URLFactory;
+
+/**
+ * @author Scott Nicklous
+ *
+ */
+public class URLFactoryImpl implements URLFactory {
+
+ private final MimeResponse mimeResp;
+
+ public URLFactoryImpl(PortletResponse resp) {
+ assert (resp instanceof MimeResponse);
+ mimeResp = (MimeResponse) resp;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.portlet.annotations.URLFactory#createActionURL()
+ */
+ @Override
+ public ActionURL createActionURL(Copy copyOpt) {
+ return mimeResp.createActionURL(copyOpt);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.portlet.annotations.URLFactory#createRenderURL()
+ */
+ @Override
+ public RenderURL createRenderURL(Copy copyOpt) {
+ return mimeResp.createRenderURL(copyOpt);
+ }
+
+ /* (non-Javadoc)
+ * @see javax.portlet.annotations.URLFactory#createResourceURL()
+ */
+ @Override
+ public ResourceURL createResourceURL() {
+ return mimeResp.createResourceURL();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.portlet.annotations.URLFactory#encodeURL(java.lang.String)
+ */
+ @Override
+ public String encodeURL(String path) {
+ return mimeResp.encodeURL(path);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/2e60a313/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/package-info.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/package-info.java b/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/package-info.java
new file mode 100644
index 0000000..ecee105
--- /dev/null
+++ b/pluto-container/src/main/java/org/apache/pluto/container/bean/processor/package-info.java
@@ -0,0 +1,25 @@
+/* Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.
+ */
+
+/**
+ * Contains code for processing annotated portlet methods.
+ *
+ * @author Scott Nicklous
+ *
+ */
+package org.apache.pluto.container.bean.processor;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/2e60a313/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionParametersImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionParametersImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionParametersImpl.java
index ee1844d..11e1c79 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionParametersImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/ActionParametersImpl.java
@@ -23,7 +23,6 @@ import java.util.Map;
import javax.portlet.ActionParameters;
import javax.portlet.MutableActionParameters;
-import javax.portlet.MutablePortletParameters;
import org.apache.pluto.container.PortletURLProvider;
import org.apache.pluto.container.PortletURLProvider.ParamType;
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/2e60a313/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderRequestImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderRequestImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderRequestImpl.java
index 81863c4..f459256 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderRequestImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderRequestImpl.java
@@ -23,7 +23,6 @@ import javax.portlet.HeaderRequest;
import javax.portlet.PortletRequest;
import org.apache.pluto.container.PortletHeaderResponseContext;
-import org.apache.pluto.container.PortletRenderResponseContext;
import org.apache.pluto.container.PortletRequestContext;
/**
http://git-wip-us.apache.org/repos/asf/portals-pluto/blob/2e60a313/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderResponseImpl.java
----------------------------------------------------------------------
diff --git a/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderResponseImpl.java b/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderResponseImpl.java
index 37845ed..1c86620 100644
--- a/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderResponseImpl.java
+++ b/pluto-container/src/main/java/org/apache/pluto/container/impl/HeaderResponseImpl.java
@@ -21,10 +21,8 @@ import java.util.Collection;
import javax.portlet.HeaderResponse;
import javax.portlet.PortletMode;
-import javax.portlet.RenderResponse;
import org.apache.pluto.container.PortletHeaderResponseContext;
-import org.apache.pluto.container.PortletRenderResponseContext;
import org.apache.pluto.container.util.ArgumentUtility;