ContextStack (LogKit API)
Keywords: org.apache.log.ContextStack,ContextStack class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.log
Class ContextStack

    java.lang.Object
      |
      +--org.apache.log.ContextStack

Deprecated. This class has been deprecated as it encouraged use of bad design practices. Use org.apache.log.ContextMap instead.

public class ContextStack
extends Object

The ContextStack records the nested context of an application. The context is an application defined characteristeric. For instance a webserver context may be defined as the session that is currently used to connect to server. A application may have context defined by current thread. A applet may have it's context defined by the name of the applet etc.

Author:
  Peter Donald

Constructor Summary
`ContextStack()` Deprecated.

Method Summary
`void` | `clear()` Deprecated. Empty the context stack.
`Object` | `get(int index)` Deprecated. Get the context at a particular depth.
`static ContextStack` | `getCurrentContext()` Deprecated. Get the Current ContextStack.
`int` | `getSize()` Deprecated. Get the number of contexts in stack.
`Object` | `pop()` Deprecated. Remove a context from top of stack and return it.
`void` | `push(Object context)` Deprecated. Push the context onto top of context stack.
`void` | `set(ContextStack stack)` Deprecated. Set the current ContextSet to be equl to other ContextStack.
`String` | `toString()` Deprecated. Format context stack into a string.
`String` | `toString(int count)` Deprecated. Format context stack into a string.

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

Constructor Detail

### ContextStack

    public ContextStack()

  Deprecated.

Method Detail

### getCurrentContext

    public static final ContextStack getCurrentContext()

  Deprecated.
  Get the Current ContextStack. This method returns a ContextStack associated with current thread. If the thread doesn't have a ContextStack associated with it then a new ContextStack is created with the name of thread as base context.

  Returns:
    the current ContextStack

### clear

    public void clear()

  Deprecated.
  Empty the context stack.

### get

    public Object get(int index)

  Deprecated.
  Get the context at a particular depth.

  Parameters:
    `index` - the depth of the context to retrieve
  Returns:
    the context

### pop

    public Object pop()

  Deprecated.
  Remove a context from top of stack and return it.

  Returns:
    the context that was on top of stack

### push

    public void push(Object context)

  Deprecated.
  Push the context onto top of context stack.

  Parameters:
    `context` - the context to place on stack

### set

    public void set(ContextStack stack)

  Deprecated.
  Set the current ContextSet to be equl to other ContextStack.

  Parameters:
    `stack` - the value to copy

### getSize

    public int getSize()

  Deprecated.
  Get the number of contexts in stack.

  Returns:
    the number of contexts in stack

### toString

    public String toString()

  Deprecated.
  Format context stack into a string. Each element in stack is printed out, separated by a '.' character.

  Overrides:
    `toString` in class `Object`
  Returns:
    the string describing context stack

### toString

    public String toString(int count)

  Deprecated.
  Format context stack into a string. Only write a maximum of count elements, separated by '.' separator. Note that elements in stack will have toString() called and every occurence of spearator character '.' replaced with '_'.

  Returns:
    the string describing context stack

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001 Apache Jakarta Project. All Rights Reserved.