Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.webengine
Class PathDescriptor

java.lang.Object
  extended by org.nuxeo.ecm.webengine.PathDescriptor
All Implemented Interfaces:
Comparable<PathDescriptor>

public class PathDescriptor
extends Object
implements Comparable<PathDescriptor>

Configure how a given path is handled by the WebEngine filter.

If autoTx is true (which is the default) then a transaction will be started each time a path matching the given path specification is requested. (the transaction is started in a filter before the JAX-RS resource is called and closed after the response is sent to the output stream). If false then no transaction handling is done. The default is to start a transaction for any path but: [^/]+/skin/.*

If stateful flag is set (the default is false) then the core session which is provided to the JAX-RS resource (through UserSession.getCoreSession()) will be reused for each request in the same HTPP session (i.e. the core session is stored in the HTTP Session and closed when the session expires). By default the provided core session has a REQUEST scope (it is closed automatically when request ends).

The value attribute is required and must be used to specify the path pattern. The path pattern is either a prefix or a regular expression. If the regex parameter is true (the default is false) then the value will be expected to be a regular expression. A prefix denotes a path starting with 'prefix'. Paths are relative to the webengine servlet (i.e. they correspond to the servlet path info in the JAX-RS servlet) - and always begin with a '/'.

Author:
Bogdan Stefanescu

Constructor Summary
PathDescriptor()
           
PathDescriptor(String value, boolean regex, boolean autoTx, boolean stateful)
           
 
Method Summary
 int compareTo(PathDescriptor o)
           
 PathMatcher createMatcher()
           
 boolean equals(Object obj)
           
 Boolean getAutoTx()
           
 PathMatcher getMatcher()
           
 Boolean getStateful()
           
 String getValue()
           
 int hashCode()
           
 boolean isAutoTx(boolean defaultValue)
           
 boolean isStateful(boolean defaultValue)
           
static void main(String[] args)
           
 boolean match(String path)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PathDescriptor

public PathDescriptor()

PathDescriptor

public PathDescriptor(String value,
                      boolean regex,
                      boolean autoTx,
                      boolean stateful)
Method Detail

getMatcher

public PathMatcher getMatcher()

getValue

public String getValue()

getAutoTx

public Boolean getAutoTx()

getStateful

public Boolean getStateful()

isAutoTx

public boolean isAutoTx(boolean defaultValue)

isStateful

public boolean isStateful(boolean defaultValue)

createMatcher

public PathMatcher createMatcher()

match

public boolean match(String path)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

compareTo

public int compareTo(PathDescriptor o)
Specified by:
compareTo in interface Comparable<PathDescriptor>

main

public static void main(String[] args)

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.