1 16 17 package org.apache.jk.core; 18 19 import java.io.IOException ; 20 21 22 30 public class MsgContext { 31 private int type; 32 private Object notes[]=new Object [32]; 33 private JkHandler next; 34 private JkChannel source; 35 private Object req; 36 private WorkerEnv wEnv; 37 private Msg msgs[]=new Msg[10]; 38 private int status=0; 39 private Object control; 41 42 private long timers[]=new long[20]; 44 45 private long jkEndpointP; 47 private long xEnvP; 48 49 public static final int TIMER_RECEIVED=0; 51 public static final int TIMER_PRE_REQUEST=1; 52 public static final int TIMER_POST_REQUEST=2; 53 54 public final Object getNote( int id ) { 55 return notes[id]; 56 } 57 58 public final void setNote( int id, Object o ) { 59 notes[id]=o; 60 } 61 62 63 public final int getType() { 64 return type; 65 } 66 67 public final void setType(int i) { 68 type=i; 69 } 70 71 public final void setLong( int i, long l) { 72 timers[i]=l; 73 } 74 75 public final long getLong( int i) { 76 return timers[i]; 77 } 78 79 81 public final WorkerEnv getWorkerEnv() { 82 return wEnv; 83 } 84 85 public final void setWorkerEnv( WorkerEnv we ) { 86 this.wEnv=we; 87 } 88 89 public final JkChannel getSource() { 90 return source; 91 } 92 93 public final void setSource(JkChannel ch) { 94 this.source=ch; 95 } 96 97 public final int getStatus() { 98 return status; 99 } 100 101 public final void setStatus( int s ) { 102 status=s; 103 } 104 105 public final JkHandler getNext() { 106 return next; 107 } 108 109 public final void setNext(JkHandler ch) { 110 this.next=ch; 111 } 112 113 115 public final void setRequest( Object req ) { 116 this.req=req; 117 } 118 119 public final Object getRequest() { 120 return req; 121 } 122 123 125 public final Msg getMsg(int i) { 126 return msgs[i]; 127 } 128 129 public final void setMsg(int i, Msg msg) { 130 this.msgs[i]=msg; 131 } 132 133 140 public byte[] getBuffer( int id ) { 141 if( msgs[id]==null ) { 143 return null; 144 } 145 return msgs[id].getBuffer(); 146 } 147 148 151 public int execute() throws IOException { 152 int status=next.invoke(msgs[0], this); 153 return status; 154 } 155 156 158 162 public void setJniEnv( long xEnvP ) { 163 this.xEnvP=xEnvP; 164 } 165 166 public long getJniEnv() { 167 return xEnvP; 168 } 169 170 174 public void setJniContext( long cContext ) { 175 this.jkEndpointP=cContext; 176 } 177 178 public long getJniContext() { 179 return jkEndpointP; 180 } 181 182 public Object getControl() { 183 return control; 184 } 185 186 public void setControl(Object control) { 187 this.control = control; 188 } 189 } 190 | Popular Tags |