Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2004 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.p13n.cache.servlets
Class CacheManagerServlet

    java.lang.Object
      javax.servlet.GenericServlet
          javax.servlet.http.HttpServlet
              com.bea.p13n.cache.servlets.CacheManagerServlet

All Implemented Interfaces:
  Serializable, Servlet, ServletConfig

public class CacheManagerServlet
extends HttpServlet

A servlet which can interact with the p13n caches.

This obeys the 'opeartion' query parameter:

- 'set': set the attributes of the cache specified by 'name'. Will use the query parameters 'enabled' ('true' or 'false'), 'maxentries', 'ttl', and 'description' to set the cache attributes. This will use the CacheFactory; therefore, setting on a cache that doesn't exist will initialize that cache (temporarily if there isn't a corresponding CacheMBean entry).
- 'flush': flush the cache specified by 'name'. If 'type' is 'local' only the local cache will be flushed (if it's been created yet); otherwise, flush the cache on all machines. This will use the Cache object and the CacheManager.
- 'get' (or anything else): will return the attributes of either the cache specified by the values of 'name' or all (if no 'name' specified). This will use the MBeans to get the values.

The output will be text/xml, like:

     <caches>
       <cache>
         <name>...</name>
         <enabled>...</enabled>
         <max-entries>...</max-entries>
         <ttl>...</ttl>
         <description>...</description>
       </cache>
     </caches>

with the contents depending upon the opearion. 'flush' will only return <cache><name>...</name></cache> blocks for each cache flushed. 'set' will return a complete <cache></cache> block with the new values for the cache (can be used to determine if one didn't get set); if there isn't a corresponding CacheMBean for the cache, then <description> wont' be sent back. 'get' will return <cache></cache> for each cache that has an MBean entry.

See Also:
  Serialized Form

Constructor Summary
`CacheManagerServlet()`

Method Summary
`void` | `doCacheFlush(HttpServletRequest req, HttpServletResponse resp)`
`void` | `doCacheGet(HttpServletRequest req, HttpServletResponse resp)`
`void` | `doCacheSet(HttpServletRequest req, HttpServletResponse resp)`
`void` | `doGet(HttpServletRequest req, HttpServletResponse resp)`
`void` | `doPost(HttpServletRequest req, HttpServletResponse resp)`
`static String` | `xmlize(String in)`

Methods inherited from class javax.servlet.http.HttpServlet
`doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service`

Methods inherited from class javax.servlet.GenericServlet
`destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CacheManagerServlet

    public CacheManagerServlet()

Method Detail

### doCacheFlush

    public void doCacheFlush(HttpServletRequest req,
                             HttpServletResponse resp)
                      throws IOException

  Throws:
    `IOException`

### doCacheGet

    public void doCacheGet(HttpServletRequest req,
                           HttpServletResponse resp)
                    throws IOException

  Throws:
    `IOException`

### doCacheSet

    public void doCacheSet(HttpServletRequest req,
                           HttpServletResponse resp)
                    throws IOException

  Throws:
    `IOException`

### doGet

    public void doGet(HttpServletRequest req,
                      HttpServletResponse resp)
               throws IOException

  Throws:
    `IOException`

### doPost

    public void doPost(HttpServletRequest req,
                       HttpServletResponse resp)
                throws IOException

  Throws:
    `IOException`

### xmlize

    public static final String xmlize(String in)

Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2004 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 BEA Systems, Inc. All Rights Reserved