org.eclipse.jetty.plus.webapp
Class PlusDescriptorProcessor

java.lang.Object
  extended by org.eclipse.jetty.webapp.IterativeDescriptorProcessor
      extended by org.eclipse.jetty.plus.webapp.PlusDescriptorProcessor
All Implemented Interfaces:
DescriptorProcessor

public class PlusDescriptorProcessor
extends IterativeDescriptorProcessor

PlusDescriptorProcessor


Field Summary
protected  WebAppContext _context
           
protected  MetaData _metaData
           
 
Fields inherited from class org.eclipse.jetty.webapp.IterativeDescriptorProcessor
__signature, _visitors
 
Constructor Summary
PlusDescriptorProcessor()
           
 
Method Summary
 void addInjections(Descriptor descriptor, XmlParser.Node node, String jndiName, Class valueClass)
          Iterate over the <injection-target> entries for a node
protected  void bindEntry(String name, Class typeClass)
          Bind a resource with the given name from web.xml of the given type with a jndi resource from either the server or the webapp's naming environment.
 void bindEnvEntry(String name, Object value)
           
 void bindMessageDestinationRef(String name, Class typeClass)
           
 void bindResourceEnvRef(String name, Class typeClass)
           
 void bindResourceRef(String name, Class typeClass)
          Bind a resource reference.
 void end(Descriptor descriptor)
           
 void start(Descriptor descriptor)
           
 void visitEnvEntry(Descriptor descriptor, XmlParser.Node node)
          JavaEE 5.4.1.3
 void visitMessageDestinationRef(Descriptor descriptor, XmlParser.Node node)
          Common Annotations Spec section 2.3: message-destination-ref is for: - javax.jms.Queue - javax.jms.Topic
 void visitPostConstruct(Descriptor descriptor, XmlParser.Node node)
          TODO If web.xml has at least 1 post-construct, then all post-constructs in fragments are ignored.
 void visitPreDestroy(Descriptor descriptor, XmlParser.Node node)
          pre-destroy is the name of a class and method to call just as the instance is being destroyed
 void visitResourceEnvRef(Descriptor descriptor, XmlParser.Node node)
          Common Annotations Spec section 2.3: resource-env-ref is for: - javax.transaction.UserTransaction - javax.resource.cci.InteractionSpec - anything else that is not a connection factory
 void visitResourceRef(Descriptor descriptor, XmlParser.Node node)
          Common Annotations Spec section 2.3: resource-ref is for: - javax.sql.DataSource - javax.jms.ConnectionFactory - javax.jms.QueueConnectionFactory - javax.jms.TopicConnectionFactory - javax.mail.Session - java.net.URL - javax.resource.cci.ConnectionFactory - org.omg.CORBA_2_3.ORB - any other connection factory defined by a resource adapter TODO If web.xml contains a resource-ref with injection targets, all resource-ref entries of the same name are ignored in web fragments.
 
Methods inherited from class org.eclipse.jetty.webapp.IterativeDescriptorProcessor
process, registerVisitor, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_context

protected WebAppContext _context

_metaData

protected MetaData _metaData
Constructor Detail

PlusDescriptorProcessor

public PlusDescriptorProcessor()
Method Detail

start

public void start(Descriptor descriptor)
Specified by:
start in class IterativeDescriptorProcessor
See Also:
IterativeDescriptorProcessor.start(org.eclipse.jetty.webapp.Descriptor)

end

public void end(Descriptor descriptor)
Specified by:
end in class IterativeDescriptorProcessor
See Also:
IterativeDescriptorProcessor.end(org.eclipse.jetty.webapp.Descriptor)

visitEnvEntry

public void visitEnvEntry(Descriptor descriptor,
                          XmlParser.Node node)
                   throws Exception
JavaEE 5.4.1.3

Parameters:
node -
Throws:
Exception

visitResourceRef

public void visitResourceRef(Descriptor descriptor,
                             XmlParser.Node node)
                      throws Exception
Common Annotations Spec section 2.3: resource-ref is for: - javax.sql.DataSource - javax.jms.ConnectionFactory - javax.jms.QueueConnectionFactory - javax.jms.TopicConnectionFactory - javax.mail.Session - java.net.URL - javax.resource.cci.ConnectionFactory - org.omg.CORBA_2_3.ORB - any other connection factory defined by a resource adapter TODO If web.xml contains a resource-ref with injection targets, all resource-ref entries of the same name are ignored in web fragments. If web.xml does not contain any injection-targets, then they are merged from all the fragments. If web.xml does not contain a resource-ref element of same name, but 2 fragments declare the same name it is an error. resource-ref entries are ONLY for connection factories the resource-ref says how the app will reference the jndi lookup relative to java:comp/env, but it is up to the deployer to map this reference to a real resource in the environment. At the moment, we insist that the jetty.xml file name of the resource has to be exactly the same as the name in web.xml deployment descriptor, but it shouldn't have to be

Parameters:
node -
Throws:
Exception

visitResourceEnvRef

public void visitResourceEnvRef(Descriptor descriptor,
                                XmlParser.Node node)
                         throws Exception
Common Annotations Spec section 2.3: resource-env-ref is for: - javax.transaction.UserTransaction - javax.resource.cci.InteractionSpec - anything else that is not a connection factory

Parameters:
node -
Throws:
Exception

visitMessageDestinationRef

public void visitMessageDestinationRef(Descriptor descriptor,
                                       XmlParser.Node node)
                                throws Exception
Common Annotations Spec section 2.3: message-destination-ref is for: - javax.jms.Queue - javax.jms.Topic

Parameters:
node -
Throws:
Exception

visitPostConstruct

public void visitPostConstruct(Descriptor descriptor,
                               XmlParser.Node node)
TODO If web.xml has at least 1 post-construct, then all post-constructs in fragments are ignored. Otherwise, post-constructs from fragments are merged. post-construct is the name of a class and method to call after all resources have been setup but before the class is put into use

Parameters:
node -

visitPreDestroy

public void visitPreDestroy(Descriptor descriptor,
                            XmlParser.Node node)
pre-destroy is the name of a class and method to call just as the instance is being destroyed

Parameters:
node -

addInjections

public void addInjections(Descriptor descriptor,
                          XmlParser.Node node,
                          String jndiName,
                          Class valueClass)
Iterate over the <injection-target> entries for a node

Parameters:
descriptor -
node -
jndiName -
valueClass -

bindEnvEntry

public void bindEnvEntry(String name,
                         Object value)
                  throws Exception
Parameters:
name -
value -
Throws:
Exception
See Also:
org.eclipse.jetty.plus.webapp.AbstractConfiguration#bindEnvEntry(java.lang.String, java.lang.String)

bindResourceRef

public void bindResourceRef(String name,
                            Class typeClass)
                     throws Exception
Bind a resource reference. If a resource reference with the same name is in a jetty-env.xml file, it will already have been bound.

Parameters:
name -
Throws:
Exception
See Also:
org.eclipse.jetty.plus.webapp.AbstractConfiguration#bindResourceRef(java.lang.String)

bindResourceEnvRef

public void bindResourceEnvRef(String name,
                               Class typeClass)
                        throws Exception
Parameters:
name -
Throws:
Exception
See Also:
org.eclipse.jetty.plus.webapp.AbstractConfiguration#bindResourceEnvRef(java.lang.String)

bindMessageDestinationRef

public void bindMessageDestinationRef(String name,
                                      Class typeClass)
                               throws Exception
Throws:
Exception

bindEntry

protected void bindEntry(String name,
                         Class typeClass)
                  throws Exception
Bind a resource with the given name from web.xml of the given type with a jndi resource from either the server or the webapp's naming environment. As the servlet spec does not cover the mapping of names in web.xml with names from the execution environment, jetty uses the concept of a Link, which is a subclass of the NamingEntry class. A Link defines a mapping of a name from web.xml with a name from the execution environment (ie either the server or the webapp's naming environment).

Parameters:
name - name of the resource from web.xml
typeClass -
Throws:
Exception


Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.