Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 1998-2015 Caucho Technology -- all rights reserved
*
* This file is part of Baratine(TM)
*
* Each copy or derived work must preserve the copyright notice and this
* notice unmodified.
*
* Baratine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Baratine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
* of NON-INFRINGEMENT. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with Baratine; if not, write to the
*
* Free Software Foundation, Inc.
* 59 Temple Place, Suite 330
* Boston, MA 02111-1307 USA
*
* @author Scott Ferguson
*/
package com.caucho.v5.ramp.jamp;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.caucho.v5.amp.ServicesAmp;
import com.caucho.v5.amp.message.HeadersNull;
import com.caucho.v5.amp.spi.MethodRefAmp;
import com.caucho.v5.amp.stub.ParameterAmp;
import com.caucho.v5.json.io.InJson;
import com.caucho.v5.json.io.InJson.Event;
import com.caucho.v5.json.io.JsonReader;
import com.caucho.v5.json.io.JsonWriter;
import com.caucho.v5.json.ser.JsonFactory;
import io.baratine.service.MethodRef;
import io.baratine.service.ResultFuture;
import io.baratine.service.ServiceException;
import io.baratine.service.ServiceExceptionIllegalArgument;
import io.baratine.web.HttpStatus;
import io.baratine.web.RequestWeb;
/**
* Method introspected using jaxrs
*/
public class JampMethodStandard extends JampMethodRest
{
private static final Logger log
= Logger.getLogger(JampMethodStandard.class.getName());
private final JsonFactory _factory;
private MethodRefAmp _methodRef;
private JampArg []_params;
private ParameterAmp[] _paramTypes;
private JampArg _paramVarArgs;
private int _argLength;
private JampMarshal _varArgsMarshal;
private ServicesAmp _manager;
JampMethodStandard(JampMethodBuilder builder)
{
_factory = builder.getJsonFactory();
_methodRef = builder.getMethod();
_manager = (ServicesAmp) _methodRef.serviceRef().manager();
_params = builder.getParams();
_paramTypes = _methodRef.parameters();
_varArgsMarshal = builder.getVarArgMarshal();
if (_varArgsMarshal != null) {
_argLength = _params.length + 1;
}
else if (_params != null) {
_argLength = _params.length;
}
else {
_argLength = 0;
}
}
/*
JampMethodStandard(MethodRef method)
{
this(new JampMethodBuilder(method));
}
*/
protected MethodRefAmp getMethod()
{
return _methodRef;
}
@Override
public boolean isClosed()
{
MethodRefAmp method = getMethod();
return method.isClosed();
}
@Override
public void doGet(RequestWeb req,
String pathInfo)
throws IOException
{
Object []args = null;
if (_params == null) {
ArrayList