亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? portgenerator.java

?? Xfire文件 用于開發web service 的一個開源工具 很好用的
?? JAVA
字號:
package org.codehaus.xfire.gen.jsr181;import java.net.MalformedURLException;import java.util.Collection;import java.util.HashMap;import java.util.Iterator;import java.util.List;import java.util.Map;import javax.xml.namespace.QName;import org.codehaus.xfire.XFireRuntimeException;import org.codehaus.xfire.annotations.AnnotationServiceFactory;import org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations;import org.codehaus.xfire.client.XFireProxyFactory;import org.codehaus.xfire.gen.GenerationContext;import org.codehaus.xfire.gen.GeneratorPlugin;import org.codehaus.xfire.service.Binding;import org.codehaus.xfire.service.Endpoint;import org.codehaus.xfire.service.Service;import org.codehaus.xfire.soap.AbstractSoapBinding;import org.codehaus.xfire.soap.Soap11Binding;import org.codehaus.xfire.soap.Soap12Binding;import org.codehaus.xfire.soap.SoapTransport;import org.codehaus.xfire.transport.TransportManager;import org.codehaus.xfire.transport.local.LocalTransport;import com.sun.codemodel.JBlock;import com.sun.codemodel.JCatchBlock;import com.sun.codemodel.JClass;import com.sun.codemodel.JCodeModel;import com.sun.codemodel.JDefinedClass;import com.sun.codemodel.JExpr;import com.sun.codemodel.JFieldVar;import com.sun.codemodel.JInvocation;import com.sun.codemodel.JMethod;import com.sun.codemodel.JMod;import com.sun.codemodel.JTryBlock;import com.sun.codemodel.JType;import com.sun.codemodel.JVar;public class PortGenerator    extends AbstractPlugin    implements GeneratorPlugin{    private JFieldVar pfVar;    private JFieldVar endpointsVar;    private JMethod getEndpoint;    private JMethod constructor;    public void generate(GenerationContext context)        throws Exception    {        for (Iterator itr = context.getServices().entrySet().iterator(); itr.hasNext();)        {            Map.Entry entry = (Map.Entry) itr.next();                        generate(context, (QName) entry.getKey(), (List) entry.getValue());        }    }        public void generate(GenerationContext context, QName name, List services)        throws Exception    {        String local = name.getLocalPart();        String ns = name.getNamespaceURI();                JCodeModel model = context.getCodeModel();                // Create the Client class        String portName = getPackage(name, context) + "." + javify(name.getLocalPart()) + "Client";       // portName = portName;                JDefinedClass servCls = model._class(portName);        /**         * Constructor         */        constructor = servCls.constructor(JMod.PUBLIC);                JType pfType = model._ref(XFireProxyFactory.class);        pfVar = servCls.field(JMod.STATIC + JMod.PRIVATE, pfType, "proxyFactory", JExpr._new(pfType));          JType hashMapType = model._ref(HashMap.class);        endpointsVar = servCls.field(JMod.PRIVATE, hashMapType, "endpoints", JExpr._new(hashMapType));          /**         * getEndpoint(Endpoint)         */        JClass objectType = model.ref(Object.class);        getEndpoint = servCls.method(JMod.PUBLIC, objectType, "getEndpoint");        JVar epVar = getEndpoint.param(Endpoint.class, "endpoint");                JBlock geBody = getEndpoint.body();        JTryBlock tryBlock = geBody._try();                JInvocation createProxy = pfVar.invoke("create");        createProxy.arg(JExpr.direct(epVar.name()).invoke("getBinding"));        createProxy.arg(JExpr.direct(epVar.name()).invoke("getUrl"));                tryBlock.body()._return(createProxy);        JCatchBlock catchBlock = tryBlock._catch(model.ref(MalformedURLException.class));        JType xreType = model._ref(XFireRuntimeException.class);        JInvocation xreThrow = JExpr._new(xreType);        xreThrow.arg("Invalid URL");        xreThrow.arg(catchBlock.param("e"));                catchBlock.body()._throw(xreThrow);                /**         * T getEndpoint(QName)         */        JMethod getEndpointByName = servCls.method(JMod.PUBLIC, objectType, "getEndpoint");        JVar epname = getEndpointByName.param(QName.class, "name");                geBody = getEndpointByName.body();                // Endpoint endpoint = (Endpoint) service.getEndpoint(name);        JType endpointType = model._ref(Endpoint.class);        JInvocation getEndpointInv = endpointsVar.invoke("get");        getEndpointInv.arg(JExpr.direct(epname.name()));        epVar = geBody.decl(endpointType, "endpoint", JExpr.cast(endpointType, getEndpointInv));                // if (endpoint == null)        JBlock noEPBlock = geBody._if(JExpr.direct(epVar.name()).eq(JExpr._null()))._then();                // throw IllegalStateException        JType iseType = model._ref(IllegalStateException.class);        JInvocation iseThrow = JExpr._new(iseType);        iseThrow.arg("No such endpoint!");        noEPBlock._throw(iseThrow);                // return endpoint                JInvocation geInvoke = JExpr.invoke(getEndpoint);        geInvoke.arg(JExpr.direct(epVar.name()));        geBody._return(geInvoke);                /**         * Collection getEndpoints()         */        JType collectionType = model.ref(Collection.class);        JMethod getEndpoints = servCls.method(JMod.PUBLIC, collectionType, "getEndpoints");        geBody = getEndpoints.body();                geBody._return(endpointsVar.invoke("values"));                // Create a Service for each Binding        for (int i = 0; i < services.size(); i++)        {            Service service = (Service) services.get(i);                        if (service.getEndpoints().size() == 0) continue;                        // Add a local binding.             // TODO: We should have a switch for this...            String ptName = service.getServiceInfo().getPortType().getLocalPart();            Soap11Binding localBind = new Soap11Binding(new QName(ns, ptName + "LocalBinding"),                                                         LocalTransport.BINDING_ID,                                                         service);            service.addBinding(localBind);            service.addEndpoint(new QName(ns, ptName + "LocalEndpoint"), localBind, "xfire.local://" + local);                        JVar serviceVar = generateService(context, servCls, constructor, service, i);                        // Add each endpoint to the Client class            Collection endpoints = service.getEndpoints();            for (Iterator eitr = endpoints.iterator(); eitr.hasNext(); )            {            	Endpoint enp = (Endpoint) eitr.next();            	                generate(context, servCls, service, serviceVar, enp);            }        }    }        protected JVar generateService(GenerationContext context, JDefinedClass servCls,                                    JMethod constructor, Service service, int number)    {        JCodeModel model = context.getCodeModel();        JVar serviceVar = servCls.field(JMod.PRIVATE, Service.class, "service" + number);                JClass serviceIntf = (JClass) service.getProperty(ServiceInterfaceGenerator.SERVICE_INTERFACE);                /**         * createService()         */        JMethod create = servCls.method(JMod.PRIVATE, void.class, "create" + number);                JType asfType = model._ref(AnnotationServiceFactory.class);        JType jsr181Type = model._ref(Jsr181WebAnnotations.class);        JType tmType = model._ref(TransportManager.class);        JType abSoapBindingType = model._ref(AbstractSoapBinding.class);        JType qnameType = model._ref(QName.class);        JType soapTransType = model._ref(SoapTransport.class);        JType hashMapType = model._ref(HashMap.class);                JVar tmVar = create.body().decl(tmType, "tm", JExpr.direct("org.codehaus.xfire.XFireFactory.newInstance().getXFire().getTransportManager()"));        JInvocation asfCons = JExpr._new(asfType);        asfCons.arg(JExpr._new(jsr181Type));        asfCons.arg(tmVar);        asfCons.arg(context.getSchemaGenerator().getBindingProviderExpr(context));                JVar propsVar = create.body().decl(hashMapType, "props", JExpr._new(hashMapType));        create.body().add(propsVar.invoke("put").arg("annotations.allow.interface").arg(JExpr.TRUE));                JVar asfVar = create.body().decl(asfType, "asf", asfCons);        JInvocation createInvoke = asfVar.invoke("create");                createInvoke.arg(JExpr.direct(serviceIntf.fullName() + ".class"));        createInvoke.arg(propsVar);                JInvocation bindingCreation = asfVar.invoke("setBindingCreationEnabled");        bindingCreation.arg(JExpr.lit(false));        create.body().add(bindingCreation);                JType serviceType = model._ref(Service.class);        create.body().assign(serviceVar, createInvoke);                for (Iterator itr = service.getBindings().iterator(); itr.hasNext();)        {            Binding binding = (Binding) itr.next();            if (!(binding instanceof AbstractSoapBinding)) continue;                        AbstractSoapBinding soapBinding = (AbstractSoapBinding) binding;            JBlock block = create.body().block();                        JInvocation createBinding;            if (soapBinding instanceof Soap12Binding)            {                createBinding = asfVar.invoke("createSoap12Binding");            }            else            {                createBinding = asfVar.invoke("createSoap11Binding");            }                        createBinding.arg(serviceVar);                        JInvocation newQN = JExpr._new(qnameType);            newQN.arg(soapBinding.getName().getNamespaceURI());            newQN.arg(soapBinding.getName().getLocalPart());            createBinding.arg(newQN);            createBinding.arg(soapBinding.getBindingId());            JVar sbVar = block.decl(abSoapBindingType, "soapBinding", createBinding);        }        constructor.body().invoke(create);        return serviceVar;    }    protected void generate(GenerationContext context, JDefinedClass servCls,                             Service service, JVar serviceVar, Endpoint endpoint)        throws Exception    {        String name = service.getSimpleName();        String ns = service.getTargetNamespace();        JCodeModel model = context.getCodeModel();                /*         * Add endpoints to constructor         */        JBlock consBody = constructor.body();        JType qnameType = model.ref(QName.class);                JDefinedClass serviceIntf = (JDefinedClass) service.getProperty(ServiceInterfaceGenerator.SERVICE_INTERFACE);        JInvocation addEndpointInv = serviceVar.invoke("addEndpoint");        JInvocation newQN = JExpr._new(qnameType);        newQN.arg(endpoint.getName().getNamespaceURI());        newQN.arg(endpoint.getName().getLocalPart());        JInvocation bindingQN = JExpr._new(qnameType);        bindingQN.arg(endpoint.getBinding().getName().getNamespaceURI());        bindingQN.arg(endpoint.getBinding().getName().getLocalPart());        addEndpointInv.arg(newQN);        addEndpointInv.arg(bindingQN);        addEndpointInv.arg(endpoint.getUrl());        JType endpointType = model.ref(Endpoint.class);        JVar epVar = consBody.decl(endpointType, javify(endpoint.getName().getLocalPart()) + "EP", addEndpointInv);        JInvocation addEndpoint = endpointsVar.invoke("put").arg(newQN).arg(epVar);        consBody.add(addEndpoint);                // Add a getFooEndpointMethod        JMethod getFooEndpoint = servCls.method(JMod.PUBLIC, serviceIntf, "get"                + javify(endpoint.getName().getLocalPart()));        JBlock geBody = getFooEndpoint.body();        geBody._return(JExpr.cast(serviceIntf, JExpr.direct("this").invoke(getEndpoint).arg(newQN)));        JMethod getFooEndpoint1 = servCls.method(JMod.PUBLIC, serviceIntf, "get"                + javify(endpoint.getName().getLocalPart()));        getFooEndpoint1.param(String.class,"url");        JBlock geBody1 = getFooEndpoint1.body();        JInvocation getEndp = JExpr.invoke(getFooEndpoint);        JVar tpe = geBody1.decl(serviceIntf, "var", getEndp );                geBody1.directStatement("org.codehaus.xfire.client.Client.getInstance(var).setUrl(url);");        geBody1._return(tpe);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
自拍偷拍亚洲欧美日韩| 99九九99九九九视频精品| 色综合中文字幕| 亚洲裸体在线观看| 成人福利电影精品一区二区在线观看| 国产精品国产三级国产aⅴ入口| 欧洲人成人精品| 久久国产精品区| 综合自拍亚洲综合图不卡区| 国产精品国产三级国产aⅴ无密码| 日本一区二区不卡视频| 欧美日韩一区久久| 成人激情开心网| 色婷婷综合久久久中文一区二区| 国产精品996| 天堂影院一区二区| 久久蜜臀中文字幕| 欧美丝袜第三区| 成av人片一区二区| 一本一本久久a久久精品综合麻豆| 色综合天天在线| 欧美日韩成人在线| 欧美在线综合视频| 日韩欧美国产三级电影视频| 欧美网站大全在线观看| 日韩亚洲欧美中文三级| 欧美在线三级电影| 精品成人私密视频| 欧美喷水一区二区| 日韩视频一区二区在线观看| 中文字幕 久热精品 视频在线| 亚洲美女视频在线观看| 麻豆一区二区三| 日本三级亚洲精品| 天堂蜜桃91精品| 国产91综合网| 国产精品一卡二卡| 日本高清成人免费播放| 在线亚洲一区二区| 精品国产免费久久| 一区二区三区色| 日韩理论片网站| 日韩国产精品久久久久久亚洲| 懂色一区二区三区免费观看 | 久久精品噜噜噜成人av农村| 国产成人啪免费观看软件 | 久久久精品中文字幕麻豆发布| 中文字幕亚洲不卡| 亚洲人快播电影网| 国产乱码精品一区二区三区五月婷| 99久久精品国产毛片| 精品久久五月天| 精品国产91洋老外米糕| 亚洲国产一区二区在线播放| 综合激情成人伊人| 国产精品中文欧美| 在线播放/欧美激情| 久久亚洲一区二区三区四区| 久久久www成人免费无遮挡大片| 亚洲国产一区在线观看| 色婷婷一区二区| 国产喂奶挤奶一区二区三区| 国产精品女主播av| 夜夜嗨av一区二区三区四季av | 亚洲r级在线视频| 婷婷综合五月天| 热久久久久久久| 国产不卡视频在线播放| 欧美zozozo| 激情久久五月天| 91蜜桃在线观看| 欧美乱熟臀69xxxxxx| 欧美精品一区二区三| 天天亚洲美女在线视频| 欧美综合一区二区| 日日夜夜精品视频免费| 4438x亚洲最大成人网| 亚洲国产精品一区二区久久| 欧美在线不卡一区| 亚洲综合一区二区精品导航| 久久不见久久见免费视频7| 欧美一区永久视频免费观看| 国产精品国产三级国产aⅴ入口| 高清在线不卡av| 国产精品久久久久四虎| 91成人免费电影| 五月天视频一区| 日韩免费高清av| 国产精品一区二区三区乱码| 中文字幕电影一区| 色综合天天综合网天天看片| 亚洲国产精品久久不卡毛片| 91精品国产91综合久久蜜臀| 久久国产麻豆精品| 国产精品久久久久久久蜜臀 | 亚洲图片一区二区| 日韩视频国产视频| 国产成人免费在线视频| 亚洲精品一二三| 欧美一卡二卡三卡| 成人免费看黄yyy456| 日韩你懂的在线观看| 国产91高潮流白浆在线麻豆| 亚洲欧美一区二区三区国产精品| 欧美日韩一区二区三区在线看| 日韩电影网1区2区| 久久九九99视频| 在线观看欧美精品| 国产麻豆91精品| 亚洲精品一区二区三区在线观看 | 日韩中文字幕一区二区三区| 精品免费一区二区三区| www.亚洲精品| 亚洲国产精品精华液ab| 欧美美女网站色| 高潮精品一区videoshd| 亚洲最大成人网4388xx| 久久综合九色综合97婷婷女人| 欧洲亚洲国产日韩| 丰满少妇在线播放bd日韩电影| 亚洲成人tv网| 日本一区二区久久| 欧美不卡在线视频| 色菇凉天天综合网| 国产成人三级在线观看| 免费观看一级特黄欧美大片| 亚洲免费在线视频一区 二区| 欧美一级片在线观看| 色综合天天做天天爱| 国产福利精品导航| 丝瓜av网站精品一区二区| 亚洲乱码中文字幕综合| 久久久久久综合| 4438x成人网最大色成网站| 91免费版pro下载短视频| 国产成人在线网站| 精品一区二区三区在线视频| 国产欧美一区在线| 99re这里只有精品6| 国产在线日韩欧美| 日本午夜一本久久久综合| 一区二区三区波多野结衣在线观看| 久久无码av三级| 日韩美一区二区三区| 在线91免费看| 制服丝袜av成人在线看| 欧美色图在线观看| 欧美在线观看视频一区二区| 91麻豆国产精品久久| 99精品国产视频| 粉嫩av一区二区三区粉嫩| 国产剧情一区二区| 国内精品国产三级国产a久久| 午夜影院在线观看欧美| 精品系列免费在线观看| 免费人成网站在线观看欧美高清| 成人av电影在线网| 51精品秘密在线观看| 国产拍揄自揄精品视频麻豆| 亚洲国产精品精华液网站| 国产一区二区在线看| 欧美性淫爽ww久久久久无| 欧美大片拔萝卜| 亚洲精品国产精品乱码不99| 热久久一区二区| 色女孩综合影院| 国产日本欧洲亚洲| 图片区小说区区亚洲影院| 成人精品一区二区三区中文字幕| 欧美精品一二三四| 中文字幕一区在线观看| 久久精品99国产精品| 在线免费观看视频一区| 国产视频亚洲色图| 免费成人av在线播放| 一本色道久久综合亚洲aⅴ蜜桃 | 黑人巨大精品欧美一区| 在线观看视频一区二区欧美日韩| 国产亚洲福利社区一区| 日韩精品乱码av一区二区| 成年人网站91| 国产免费观看久久| 国产呦萝稀缺另类资源| 欧美一区二区三区在线电影| 一区二区三区欧美日| av中文字幕亚洲| 久久蜜桃av一区二区天堂| 久久激情综合网| 欧美一区二区日韩| 午夜私人影院久久久久| 91久久国产最好的精华液| 国产精品―色哟哟| 大胆亚洲人体视频| 久久精品欧美日韩| 国产成人a级片| 国产日韩三级在线| 国产成人免费视频一区| 久久免费午夜影院| 国产·精品毛片| 国产精品私房写真福利视频|