protected void performRequest(GadgletRequestWrapper request,
GadgletResponse gadgletResponse, HttpServletResponse response) {
String gadgetName = null;
ReqActionTypes actionType = null;
BasicRequestHandler handler = null;
String requestHandlerPackageName = null;
gadgletResponse.setUserContainer(request.getOpenSocialConsumerKey());
try {
actionType = request.getGadgetActionType();
gadgetName = request.getGadgetName();
Gadget g = request.getRequestedGadget();
String contentName = request.getContentName();
if(g!=null)
requestHandlerPackageName = g.getHandlerPackageName();
handler = RequestHandlerFactory.getGadgetRequestHandler(gadgetName,gadgetsRootPackageName,requestHandlerPackageName,contentName);
if (actionType.equals(ReqActionTypes.CONFIG))
handler.doConfig(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.VIEW))
handler.doView(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.DELETE))
handler.doDelete(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.ADD))
handler.doAdd(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.UPDATE))
handler.doUpdate(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.SEARCH))
handler.doSearch(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.INVITE_FRIEND))
handler.doInvite(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.ACCEPT_FRIEND))
handler.doAcceptFriend(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.REJECT_FRIEND))
handler.doRejectFriend(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.GET_FRIENDS))
handler.doGetFriends(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.GET_DOMAIN_USERS))
handler.doGetDomainUsers(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.GET_INVITATIONS))
handler.doGetInvitations(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.SHARE))
handler.doShare(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.SHARED_LIST))
handler.doSharedList(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.ADD_PROFILE))
handler.addProfile(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.REMOVE_FRIEND))
handler.doRemoveFriend(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.UPDATE_PROFILE))
handler.updateProfile(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.GET_PROFILE))
handler.getProfile(request, gadgletResponse);
else if (actionType.equals(ReqActionTypes.CUSTOM) && request.getCustomAction() != null){
// will try custom action, using reflection ......
Class<?> args[] = new Class[2];