* @param type
* @param id
*/
public void registerClass(Class<?> type, int id){
Object typeInstance = FrameworkUtils.newInstance(type);
TextData txt = null;
TextData txt2 = null;
// Type and id checking for reserved values
if (id > 0) {
boolean error = false;
switch (id) {
case Constants.HTTP_FACTORY_RESPONSE: {
if (typeInstance instanceof HTTPBaseResponse == false) {
error = true;
txt2 = new TextData("HTTPBaseResponse");
}
break;
}
case Constants.HTTP_FACTORY_REQUEST: {
if (typeInstance instanceof HTTPBaseRequest == false) {
error = true;
txt2 = new TextData("HTTPBaseRequest");
}
break;
}
case Constants.HTTP_FACTORY_SESSION: {
if (typeInstance instanceof HTTPSession == false) {
error = true;
txt2 = new TextData("HTTPSession");
}
break;
}
}
if (error == true) {
DistributedAccessException ex = new DistributedAccessException();
txt = new TextData(FrameworkUtils.getClassName(type,false));
ex.setWithParams(Framework.Constants.SP_ER_USER, new TextData(Application.getMsgCatalog().getString(Constants.HTTP_SET, Constants.HTTP_MSG_FACTORY_NOT_HTTP_MESSAGE)), txt, txt2, (DataValue)null, (DataValue)null, (DataValue)null, (DataValue)null, (DataValue)null, (DataValue)null, (DataValue)null);
throw ex;
}
}
if (typeInstance instanceof HTTPBaseRequest) {
txt = new TextData(Constants.HTTP_FACTORY_REQUEST, TextData.qq_Resolver.cINTEGERVALUE);
txt2 = new TextData("HTTPBaseRequest");
}
else if (typeInstance instanceof HTTPBaseResponse) {
txt = new TextData(Constants.HTTP_FACTORY_RESPONSE, TextData.qq_Resolver.cINTEGERVALUE);
txt2 = new TextData("HTTPBaseResponse ");
}
else if (typeInstance instanceof HTTPSession) {
txt = new TextData(Constants.HTTP_FACTORY_SESSION, TextData.qq_Resolver.cINTEGERVALUE);
txt2 = new TextData("HTTPSession ");
}
else if (id > 0) {
txt = new TextData(id, TextData.qq_Resolver.cINTEGERVALUE);
txt2 = txt;
}
else {
return;
}