http://www.unix.org.ua/orelly/java-ent/servlet/ch10_01.htm

http://www.unix.org.ua/orelly/java-ent/servlet/ch10_02.htm

http://www.oracle.com/technology/sample_code/tech/java/servlets/htdocs/basic.htm

import java.io.*;
import java.util.zip.*;

public class CompressUtils
{

public CompressUtils()
{
}

public static byte[] compressObjectToBytesArray(Object obj)
throws IOException
{
byte abyte0[] = null;
ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
ObjectOutputStream objectoutputstream = new ObjectOutputStream(bytearrayoutputstream);
objectoutputstream.writeObject(obj);
objectoutputstream.close();
Deflater deflater = new Deflater(9);
byte abyte1[] = bytearrayoutputstream.toByteArray();
deflater.setInput(abyte1);
deflater.finish();
byte abyte2[] = new byte[abyte1.length];
int j = abyte2.length;
int k = 0;
int i;
while((i = deflater.deflate(abyte2, k, j)) == j)
{
byte abyte3[] = new byte[abyte2.length + j];
for(int i1 = 0; i1 != abyte2.length; i1++)
abyte3[i1] = abyte2[i1];

k = abyte2.length;
abyte2 = abyte3;
}
int l = (abyte2.length – j) + i;
abyte0 = new byte[l];
for(int j1 = 0; j1 != l; j1++)
abyte0[j1] = abyte2[j1];

return abyte0;
}

public static Object decompressObjectFromBytesArray(byte abyte0[])
throws DataFormatException, IOException, ClassNotFoundException
{
byte abyte1[] = null;
Inflater inflater = new Inflater();
inflater.setInput(abyte0);
byte abyte2[] = new byte[abyte0.length * 3];
int j = abyte2.length;
int k = 0;
int i;
while((i = inflater.inflate(abyte2, k, j)) == j)
{
byte abyte3[] = new byte[abyte2.length + j];
for(int i1 = 0; i1 != abyte2.length; i1++)
abyte3[i1] = abyte2[i1];

k = abyte2.length;
abyte2 = abyte3;
}
int l = (abyte2.length – j) + i;
abyte1 = new byte[l];
for(int j1 = 0; j1 != l; j1++)
abyte1[j1] = abyte2[j1];

ObjectInputStream objectinputstream = new ObjectInputStream(new ByteArrayInputStream(abyte1));
return objectinputstream.readObject();
}
}

============================================================

// Source File Name: TableRow.java

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class TableRow implements Serializable
{
Map row;

public TableRow()
{
row = new HashMap();
}

public TableRow(TableRow tablerow)
{
row = new HashMap();
if(tablerow != null)
row = new HashMap(tablerow.getInternalStruct());
else
row = new HashMap();
}

public int size()
{
return row.size();
}

public void add(int i, Object obj)
{
row.put(new Integer(i), obj);
}

public void add(String s, Object obj)
{
row.put(s, obj);
}

public Object get(int i)
{
return row.get(new Integer(i));
}

public Map getInternalStruct()
{
return row;
}

public Object get(String s)
{
return row.get(s);
}

public void copy(TableRow tablerow)
{
row.putAll(tablerow.getInternalStruct());
}

}
============================
// Source File Name: Table.java

import TableRow;
import java.util.List;

public interface Table
{

public abstract void addRow(TableRow tablerow);

public abstract void addObject(Object obj);

public abstract Object getObject(int i);

public abstract void copy(Table table);

public abstract void copyByVal(Table table);

public abstract TableRow getRow(int i);

public abstract Object getValueAt(int i, int j);

public abstract int getRowCount();

public abstract void removeRow(int i);

public abstract void removeAllRows();

public abstract List getInternDataStructure();

public abstract void merge(Table table);

public abstract boolean isContained(int i, String s);

public abstract TableRow retrieveRow(String s, int i);
}
========================

// Source File Name: TableImpl.java

import TableRow;
import java.io.Serializable;
import java.util.*;

public class TableImpl implements Table, Serializable
{
private List list;
static final long serialVersionUID = 0xc106e9c97c4f9cdaL;

public TableImpl()
{
list = new ArrayList();
}

public TableImpl(Table table)
{
list = new ArrayList();
copyByVal(table);
}

public void copy(Table table)
{
list.addAll(table.getInternDataStructure());
}

public void copyByVal(Table table)
{
ListIterator listiterator = table.getInternDataStructure().listIterator();
Object obj = null;
TableRow tablerow;
for(; listiterator.hasNext(); list.add(tablerow))
tablerow = new TableRow((TableRow)listiterator.next());

}

public List getInternDataStructure()
{
return list;
}

public void removeAllRows()
{
list.clear();
}

public void addRow(TableRow tablerow)
{
list.add(tablerow);
}

public void addObject(Object obj)
{
list.add(obj);
}

public Object getObject(int i)
{
return list.get(i);
}

public void removeRow(int i)
{
list.remove(i);
}

public int getRowCount()
{
return list.size();
}

public TableRow getRow(int i)
{
return (TableRow)list.get(i);
}

public TableRow retrieveRow(String s, int i)
{
ListIterator listiterator = list.listIterator();
TableRow tablerow = null;
while(listiterator.hasNext())
{
tablerow = (TableRow)listiterator.next();
if(tablerow.get(i).equals(s))
return tablerow;
}
return tablerow;
}

public Object getValueAt(int i, int j)
{
TableRow tablerow = getRow(i);
if(tablerow != null)
{
Object obj = tablerow.get(j);
if(obj != null)
return obj;
}
return new String(“”);
}

public boolean isContained(int i, String s)
{
ListIterator listiterator = list.listIterator();
Object obj = null;
Object obj1 = null;
while(listiterator.hasNext())
{
TableRow tablerow = (TableRow)listiterator.next();
if(tablerow != null)
{
String s1 = (String)tablerow.get(i);
if(s1 != null && s.equals(s1.trim()))
return true;
}
}
return false;
}

public void merge(Table table)
{
if(table == null)
{
return;
} else
{
list.addAll(table.getInternDataStructure());
return;
}
}

}
========================
==================================================

// Source File Name: TableRowUtils.java

import Table;
import TableRow;
import java.io.PrintStream;
import java.util.*;

public class TableRowUtils
{

public TableRowUtils()
{
}

public static void printTable(Table table)
{
try
{
printTable(table, “”, 0);
}
catch(Exception exception) { }
}

public static void printTable(Table table, String s)
{
try
{
printTable(table, s, 0);
}
catch(Exception exception) { }
}

public static void printRow(TableRow tablerow)
{
try
{
printRow(tablerow, 0);
}
catch(Exception exception) { }
}

private static void printTable(Table table, String s, int i)
{
printLevel(i);
System.out.print(“{TABLE@” + s + “}:\n”);
for(int j = 0; table != null && j < table.getRowCount(); j++)
{
TableRow tablerow = table.getRow(j);
printRow(tablerow, j, i + 1);
}

}

private static void printRow(TableRow tablerow, int i)
{
printRow(tablerow, 0, 0);
}

private static void printRow(TableRow tablerow, int i, int j)
{
printLevel(j);
System.out.print(“{ROW@” + i + “L}:\n”);
Map map = tablerow.getInternalStruct();
java.util.Set set = map.keySet();
TreeSet treeset = new TreeSet(set);
for(Iterator iterator = treeset.iterator(); iterator.hasNext();)
{
Object obj = iterator.next();
Object obj1 = map.get(obj);
if(obj1 instanceof Table)
printTable((Table)obj1, obj.toString(), j + 1);
else
if(obj1 instanceof TableRow)
{
printRow((TableRow)obj1, j + 1);
} else
{
printLevel(j + 1);
System.out.print(” “);
System.out.print(“[” + obj + “:” + obj1 + “]\n”);
}
}

}

private static void printLevel(int i)
{
for(int j = 0; j < i; j++)
System.out.print(” “);

}
}
===========================================
// Source File Name: LocationInfo.java

import java.io.*;

public class LocationInfo
implements Serializable
{

public LocationInfo(Throwable throwable, String s)
{
if(throwable == null)
return;
String s1;
synchronized(sw)
{
throwable.printStackTrace(pw);
s1 = sw.toString();
sw.getBuffer().setLength(0);
}
int i = s1.lastIndexOf(s);
if(i == -1)
return;
i = s1.indexOf(LINE_SEP, i);
if(i == -1)
return;
i += LINE_SEP_LEN;
int j = s1.indexOf(LINE_SEP, i);
if(j == -1)
return;
if(!inVisualAge)
{
i = s1.lastIndexOf(“at “, j);
if(i == -1)
return;
i += 3;
}
fullInfo = s1.substring(i, j);
}

public String getClassName()
{
if(fullInfo == null)
return “?”;
if(className == null)
{
int i = fullInfo.lastIndexOf(‘(‘);
if(i == -1)
{
className = “?”;
} else
{
i = fullInfo.lastIndexOf(‘.’, i);
int j = 0;
if(inVisualAge)
j = fullInfo.lastIndexOf(‘ ‘, i) + 1;
if(i == -1)
className = “?”;
else
className = fullInfo.substring(j, i);
}
}
return className;
}

public String getFileName()
{
if(fullInfo == null)
return “?”;
if(fileName == null)
{
int i = fullInfo.lastIndexOf(‘:’);
if(i == -1)
{
fileName = “?”;
} else
{
int j = fullInfo.lastIndexOf(‘(‘, i – 1);
fileName = fullInfo.substring(j + 1, i);
}
}
return fileName;
}

public String getLineNumber()
{
if(fullInfo == null)
return “?”;
if(lineNumber == null)
{
int i = fullInfo.lastIndexOf(‘)’);
int j = fullInfo.lastIndexOf(‘:’, i – 1);
if(j == -1)
lineNumber = “?”;
else
lineNumber = fullInfo.substring(j + 1, i);
}
return lineNumber;
}

public String getMethodName()
{
if(fullInfo == null)
return “?”;
if(methodName == null)
{
int i = fullInfo.lastIndexOf(‘(‘);
int j = fullInfo.lastIndexOf(‘.’, i);
if(j == -1)
methodName = “?”;
else
methodName = fullInfo.substring(j + 1, i);
}
return methodName;
}

private static final String LINE_SEP = System.getProperty(“line.separator”);
private static final int LINE_SEP_LEN = LINE_SEP.length();
transient String lineNumber;
transient String fileName;
transient String className;
transient String methodName;
public String fullInfo;
private static StringWriter sw;
private static PrintWriter pw;
public static final String NA = “?”;
static final long serialVersionUID = 0xed99bbe14a91a57cL;
static boolean inVisualAge = false;

static
{
sw = new StringWriter();
pw = new PrintWriter(sw);
try
{
Class class1 = Class.forName(“com.ibm.uvm.tools.DebugSupport”);
inVisualAge = true;
}
catch(Throwable throwable) { }
}
}

==========================================
==========================================
==========================================
==========================================
//ServletConException.java
public class ServletConException extends Exception
{
public ServletConException() {
/* empty */
}

public ServletConException(String string) {
super(string);
}
}
================================
//ServletPack.java

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.util.zip.Deflater;
import java.util.zip.Inflater;

import javax.rmi.PortableRemoteObject;

import TableRow;
import MonitorActivities;

public class ServletPack
{

public TableRow send(TableRow tablerow) {
MonitorActivities.resetStartMonitorTime();
TableRow tablerow_0_ = null;
Object object = null;
URLConnection urlconnection = null;
for (int i = 0; i < 3; i++) {
try {
if (urlconnection == null)
urlconnection = getConnection();
else
System.out.println(“connection is existing”);
byte[] is = compress(tablerow);
urlconnection.setRequestProperty(“Content-length”,
new Integer(is.length)
.toString());
setObjectOutStream(urlconnection, is);
tablerow_0_ = getObjectInStream(urlconnection);
} catch (MalformedURLException malformedurlexception) {
continue;
} catch (IOException ioexception) {
ioexception.printStackTrace();
System.out.println(“”);
System.out.println(“Retry Servlet = ” + i);
urlconnection = null;
continue;
} catch (Exception exception) {
exception.printStackTrace();
continue;
}
break;
}
return tablerow_0_;
}

public static byte[] compress(TableRow tablerow) throws Exception {
Object object = null;
ByteArrayOutputStream bytearrayoutputstream
= new ByteArrayOutputStream();
ObjectOutputStream objectoutputstream
= new ObjectOutputStream(bytearrayoutputstream);
objectoutputstream.writeObject(tablerow);
objectoutputstream.close();
Deflater deflater = new Deflater(9);
byte[] is = bytearrayoutputstream.toByteArray();
System.out.println(“uncompressed” + is.length);
deflater.setInput(is);
deflater.finish();
byte[] is_1_ = new byte[is.length];
int i = is_1_.length;
byte[] is_2_;
int i_3_;
for (int i_4_ = 0; (i_3_ = deflater.deflate(is_1_, i_4_, i)) == i;
is_1_ = is_2_) {
is_2_ = new byte[is_1_.length + i];
for (int i_5_ = 0; i_5_ != is_1_.length; i_5_++)
is_2_[i_5_] = is_1_[i_5_];
i_4_ = is_1_.length;
}
int i_6_ = is_1_.length – i + i_3_;
byte[] is_7_ = new byte[i_6_];
for (int i_8_ = 0; i_8_ != i_6_; i_8_++)
is_7_[i_8_] = is_1_[i_8_];
System.out.println(“compressed” + is_7_.length);
return is_7_;
}

public URLConnection getConnection() {
URL url = null;
try {
url = new URL(http://localhost:7001/RemoteServiceServlet);
System.out.println(“before getting connection —– url –>”
+ url);
} catch (MalformedURLException malformedurlexception) {
malformedurlexception.printStackTrace();
}
HttpURLConnection httpurlconnection = null;
try {
System.out.println(“trying to open url connection–“);
httpurlconnection = (HttpURLConnection) url.openConnection();
System.out.println(“after getting connection —–“);
} catch (IOException ioexception) {
ioexception.printStackTrace();
}
httpurlconnection.setRequestProperty(“Content-Type”,
“application/octet-stream”);
return httpurlconnection;
}

public static void setObjectOutStream
(URLConnection urlconnection, byte[] is) throws Exception {
urlconnection.setUseCaches(false);
urlconnection.setDoInput(true);
urlconnection.setDoOutput(true);
ObjectOutputStream objectoutputstream
= new ObjectOutputStream(urlconnection.getOutputStream());
objectoutputstream.writeObject(is);
objectoutputstream.flush();
objectoutputstream.close();
}

public static TableRow getObjectInStream(URLConnection urlconnection)
throws Exception {
Object object = null;
Object object_9_ = null;
TableRow tablerow = null;
ObjectInputStream objectinputstream
= new ObjectInputStream(urlconnection.getInputStream());
byte[] is = (byte[]) objectinputstream.readObject();
if (is != null)
tablerow = decompress(is);
else
System.out.println(“received is null”);
objectinputstream.close();
return tablerow;
}

public static TableRow decompress(byte[] is) throws Exception {
TableRow tablerow = null;
Object object = null;
System.out.println
(“size of the bytes before decompression in ClientSide::”
+ is.length);
Inflater inflater = new Inflater();
inflater.setInput(is);
byte[] is_10_ = new byte[is.length * 3];
int i = is_10_.length;
byte[] is_11_;
int i_12_;
for (int i_13_ = 0; (i_12_ = inflater.inflate(is_10_, i_13_, i)) == i;
is_10_ = is_11_) {
is_11_ = new byte[is_10_.length + i];
for (int i_14_ = 0; i_14_ != is_10_.length; i_14_++)
is_11_[i_14_] = is_10_[i_14_];
i_13_ = is_10_.length;
}
int i_15_ = is_10_.length – i + i_12_;
System.out.println(“totalLength ” + i_15_);
byte[] is_16_ = new byte[i_15_];
for (int i_17_ = 0; i_17_ != i_15_; i_17_++)
is_16_[i_17_] = is_10_[i_17_];
System.out.println
(“size of the bytes after decompression::Client Side”
+ is_16_.length);
ObjectInputStream objectinputstream
= new ObjectInputStream(new ByteArrayInputStream(is_16_));
Object object_18_ = objectinputstream.readObject();
if (object_18_ != null)
tablerow = (TableRow) (PortableRemoteObject.narrow
(object_18_,
(class$TableRow == null
? (class$TableRow
= class$(“TableRow”))
: class$TableRow)));
objectinputstream.close();
return tablerow;
}

static Class class$(String string) {
Class var_class;
try {
var_class = Class.forName(string);
} catch (ClassNotFoundException classnotfoundexception) {
throw new NoClassDefFoundError().initCause(classnotfoundexception);
}
return var_class;
}
}
=================================================

import javax.swing.JFrame;
import javax.swing.JOptionPane;

import Session;

public class MonitorActivities implements Runnable
{
private static final int DELAY = 1000;
private static long startMonitorTime;
private JFrame frame;
private Session session;
private long timeOut;
private boolean stop = false;

public MonitorActivities(JFrame jframe) {
frame = jframe;
timeOut = 3600000L;
resetStartMonitorTime();
}

public void setSession(Session session) {
this.session = session;
}

public static void resetStartMonitorTime() {
startMonitorTime = System.currentTimeMillis();
}

public void run() {
while (!stop) {
if (System.currentTimeMillis() – startMonitorTime >= timeOut) {
if (((DesktopFrame) frame).getBusy())
resetStartMonitorTime();
else {
try {
session.getSessions()
.signOut();
} catch (Exception exception) {

}
if (frame != null && frame.isVisible()
&& session.isLogon())
JOptionPane.showMessageDialog
(frame,
“System Idle time expired. User has been logged out!”,
“Prog”, 1);
shutdown();
stop = true;
break;
}
} else {
try {
Thread.sleep(1000L);
} catch (InterruptedException interruptedexception) {
/* empty */
}
}
}
}

public void stop() {
stop = true;
}
}
================================
public interface Communicator
{
public void sendRequest(Object object);

public Object getResponse();
}

==========================================
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.BindException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.zip.DataFormatException;

import CompressUtils;

public class HttpObjectCommunicator implements Communicator
{
private final int MAX_ATTEMPTS = 10;
private String url = null;
private HttpURLConnection connection = null;
private byte[] responsebytes = null;

public HttpObjectCommunicator(String string) {
url = string;
}

protected void setConnection(HttpURLConnection httpurlconnection) {
connection = httpurlconnection;
}

protected HttpURLConnection getConnection() throws IOException {
if (connection == null) {
URL url = new URL(this.url);
connection = (HttpURLConnection) url.openConnection();
connection.setUseCaches(false);
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setRequestProperty(“Content-Type”,
“application/octet-stream”);
connection.setRequestMethod(“POST”);
}
return connection;
}

private void doConnect(HttpURLConnection httpurlconnection)
throws IOException {
int i = 10;
boolean bool;
do {
bool = false;
try {
httpurlconnection.connect();
} catch (IOException ioexception) {
if (ioexception instanceof BindException) {
String string = ioexception.getMessage().toLowerCase();
if (string.equals(“address in use”) && –i > 0)
bool = true;
}
if (!bool)
throw ioexception;
}
} while (bool);
}

private void doDisconnect(HttpURLConnection httpurlconnection) {
if (httpurlconnection != null)
httpurlconnection.disconnect();
}

public void sendRequest(Object object) {
HttpURLConnection httpurlconnection = null;
boolean bool = false;
for (int i = 0; i < 3; i++) {
try {
byte[] is = CompressUtils.compressObjectToBytesArray(object);
httpurlconnection = getConnection();
httpurlconnection.setRequestProperty(“Content-length”,
new Integer(is.length)
.toString());
doConnect(httpurlconnection);
ObjectOutputStream objectoutputstream
= new ObjectOutputStream(httpurlconnection
.getOutputStream());
objectoutputstream.writeObject(is);
objectoutputstream.flush();
objectoutputstream.close();
bool = true;
} catch (MalformedURLException malformedurlexception) {
System.out.println
(“MalformedURLException:- URL IS WRONG:” + url + “:”
+ malformedurlexception.toString());
return;
} catch (IOException ioexception) {
System.out.println(“Retry SendHttpObject = ” + i
+ “:”
+ ioexception.toString());
doDisconnect(httpurlconnection);
setConnection(null);
continue;
} catch (Exception exception) {
System.out.println(exception.toString());
continue;
}
break;
}
if (bool) {
try {
ObjectInputStream objectinputstream
= new ObjectInputStream(httpurlconnection
.getInputStream());
responsebytes = (byte[]) objectinputstream.readObject();
objectinputstream.close();
doDisconnect(httpurlconnection);
setConnection(null);
} catch (IOException ioexception) {
System.out.println(“receiveHttpResponse:”
+ ioexception.toString());
} catch (ClassNotFoundException classnotfoundexception) {
System.out.println(“receiveHttpResponse:”
+ classnotfoundexception
.toString());
}
}
}

public Object getResponse() {
do {
if (responsebytes != null) {
Object object;
try {
object
= CompressUtils
.decompressObjectFromBytesArray(responsebytes);
} catch (DataFormatException dataformatexception) {
System.out.println(dataformatexception
.toString());
break;
} catch (IOException ioexception) {
System.out.println(ioexception.toString());
break;
} catch (ClassNotFoundException classnotfoundexception) {
System.out.println(classnotfoundexception
.toString());
break;
}
return object;
}
} while (false);
System.out.println(“received is null”);
return null;
}
}

===========================
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.lang.reflect.UndeclaredThrowableException;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import ServiceRequest;
import ServiceResponse;

import MonitorActivities;

public class ServiceProxy implements InvocationHandler
{
private String serviceName = null;
private static Map services = new HashMap();

public static Object newInstance(Class var_class) {
if (!services.containsKey(var_class.getName())) {
Class[] var_classes;
if (var_class.isInterface())
var_classes = new Class[] { var_class };
else
var_classes = var_class.getInterfaces();
ServiceProxy serviceproxy = new ServiceProxy(var_class.getName());
Object object
= Proxy.newProxyInstance(Thread.currentThread()
.getContextClassLoader(),
var_classes, serviceproxy);
services.put(var_class.getName(), object);
}
return services.get(var_class.getName());
}

private ServiceProxy(String string) {
serviceName = string;
}

public Object invoke(Object object, Method method, Object[] objects)
throws Throwable {
object_0_ = object_7_;
break while_2_;
}
}

==============================================
// Source File Name: ServiceRequest.java

import java.io.Serializable;
import java.util.Arrays;

public class ServiceRequest
implements Serializable
{

public ServiceRequest()
{
}

public String getService()
{
return service;
}

public void setService(String s)
{
service = s;
}

public String getMethod()
{
return method;
}

public void setMethod(String s)
{
method = s;
}

public Class[] getMethodParamTypes()
{
return methodParamTypes;
}

public void setMethodParamTypes(Class aclass[])
{
methodParamTypes = aclass;
}

public Object[] getArgs()
{
return args;
}

public void setArgs(Object aobj[])
{
args = aobj;
}

public boolean equals(Object obj)
{
if(this == obj)
return true;
if(!(obj instanceof ServiceRequest))
return false;
ServiceRequest servicerequest = (ServiceRequest)obj;
if(!Arrays.equals(args, servicerequest.args))
return false;
if(method == null ? servicerequest.method != null : !method.equals(servicerequest.method))
return false;
if(!Arrays.equals(methodParamTypes, servicerequest.methodParamTypes))
return false;
return service == null ? servicerequest.service == null : service.equals(servicerequest.service);
}

public int getRequestCode()
{
return requestCode;
}

public void setRequestCode(int i)
{
requestCode = i;
}

private String service;
private String method;
private Class methodParamTypes[];
private Object args[];
private int requestCode;
}
==========================================
// Source File Name: ServiceResponse.java
import java.io.Serializable;

public class ServiceResponse implements Serializable
{

public ServiceResponse()
{
}

public int getRequestCode()
{
return requestCode;
}

public void setRequestCode(int i)
{
requestCode = i;
}

public boolean isSuccess()
{
return success;
}

public void setSuccess(boolean flag)
{
success = flag;
}

public Object getResult()
{
return result;
}

public void setResult(Object obj)
{
result = obj;
}

public Throwable getError()
{
return error;
}

public void setError(Throwable throwable)
{
error = throwable;
}

private int requestCode;
private boolean success;
private Object result;
private Throwable error;
}
========================================

Leave a Reply