Package org.codehaus.jam

Examples of org.codehaus.jam.JamServiceFactory


     *
     * @return Returns XmlSchema.
     * @throws Exception
     */
    public Collection buildWSDLTypes() throws Exception {
        JamServiceFactory factory = JamServiceFactory.getInstance();
        JamServiceParams jam_service_parms = factory.createServiceParams();
        // setting the classLoder
        // jam_service_parms.setParentClassLoader(factory.createJamClassLoader(classLoader));
        // it can posible to add the classLoader as well
        jam_service_parms.addClassLoader(generationParams.getClassLoader());
        jam_service_parms.includeClass(generationParams.getSourceClassName());

        for (int count = 0; count < generationParams.getExtraClasses().size(); ++count) {
            jam_service_parms.includeClass((String)generationParams.getExtraClasses().get(count));
        }

        JamService service = factory.createService(jam_service_parms);
        QName extraSchemaTypeName = null;
        JamClassIterator jClassIter = service.getClasses();
        // all most all the time the ittr will have only one class in it
        while (jClassIter.hasNext()) {
            JClass jclass = (JClass)jClassIter.next();
View Full Code Here


     *
     * @return Returns XmlSchema.
     * @throws Exception
     */
    public Collection buildWSDLTypes() throws Exception {
        JamServiceFactory factory = JamServiceFactory.getInstance();
        JamServiceParams jam_service_parms = factory.createServiceParams();
        // setting the classLoder
        // jam_service_parms.setParentClassLoader(factory.createJamClassLoader(classLoader));
        // it can posible to add the classLoader as well
        jam_service_parms.addClassLoader(classLoader);
        jam_service_parms.includeClass(className);
        JamService service = factory.createService(jam_service_parms);

        JamClassIterator jClassIter = service.getClasses();
        // all most all the time the ittr will have only one class in it
        while (jClassIter.hasNext()) {
            JClass jclass = (JClass)jClassIter.next();
View Full Code Here

     * @return Returns XmlSchema.
     * @throws Exception
     */
    public Collection buildWSDLTypes() throws Exception
    {
        JamServiceFactory factory = JamServiceFactory.getInstance();
        JamServiceParams jam_service_parms = factory.createServiceParams();
        //setting the classLoder
//        jam_service_parms.setParentClassLoader(factory.createJamClassLoader(classLoader));
        //it can posible to add the classLoader as well
        jam_service_parms.addClassLoader(classLoader);
        jam_service_parms.includeClass(className);
        JamService service = factory.createService(jam_service_parms);

        JamClassIterator jClassIter = service.getClasses();
        //all most all the time the ittr will have only one class in it
        while (jClassIter.hasNext())
        {
View Full Code Here

     *
     * @return Returns XmlSchema.
     * @throws Exception
     */
    public Collection buildWSDLTypes() throws Exception {
        JamServiceFactory factory = JamServiceFactory.getInstance();
        JamServiceParams jam_service_parms = factory.createServiceParams();
        //setting the classLoder
//        jam_service_parms.setParentClassLoader(factory.createJamClassLoader(classLoader));
        //it can posible to add the classLoader as well
        jam_service_parms.addClassLoader(generationParams.getClassLoader());
        jam_service_parms.includeClass(generationParams.getSourceClassName());
       
        for ( int count = 0 ; count < generationParams.getExtraClasses().size() ; ++count )
        {
            jam_service_parms.includeClass((String)generationParams.getExtraClasses().get(count));
        }
       
        JamService service = factory.createService(jam_service_parms);
        QName extraSchemaTypeName = null;
        JamClassIterator jClassIter = service.getClasses();
        //all most all the time the ittr will have only one class in it
        while (jClassIter.hasNext()) {
            JClass jclass = (JClass) jClassIter.next();
View Full Code Here

            String sourceDir = source + "/src/main/java";

            System.out.println("Parsing source files in: " + sourceDir);

            JamServiceFactory jamServiceFactory = JamServiceFactory.getInstance();
            JamServiceParams params = jamServiceFactory.createServiceParams();
            File[] dirs = new File[] {
                new File(sourceDir)
            };
            params.includeSourcePattern(dirs, "**/*.java");
            JamService jam = jamServiceFactory.createService(params);

            {
                CSharpClassesGenerator script = new CSharpClassesGenerator();
                script.setJam(jam);
                script.setTargetDir(target + "/src/main/csharp");
View Full Code Here

     * @throws Exception
     */
    public Collection generateSchema() throws Exception {
        loadCustomSchemaFile();
        loadMappingFile();
        JamServiceFactory factory = JamServiceFactory.getInstance();
        JamServiceParams jam_service_parms = factory.createServiceParams();
        //setting the classLoder
        //it can posible to add the classLoader as well
        jam_service_parms.addClassLoader(classLoader);
        jam_service_parms.includeClass(className);

        for (int count = 0; count < getExtraClasses().size(); ++count) {
            jam_service_parms.includeClass((String) getExtraClasses().get(count));
        }
        JamService jamService = factory.createService(jam_service_parms);
        QName extraSchemaTypeName;
        JamClassIterator jClassIter = jamService.getClasses();
        //all most all the time the ittr will have only one class in it
        while (jClassIter.hasNext()) {
            JClass jclass = (JClass) jClassIter.next();
View Full Code Here

            String sourceDir = source + "/src/main/java";

            System.out.println("Parsing source files in: " + sourceDir);

            JamServiceFactory jamServiceFactory = JamServiceFactory.getInstance();
            JamServiceParams params = jamServiceFactory.createServiceParams();
            File[] dirs = new File[] {
                new File(sourceDir)
            };
            params.includeSourcePattern(dirs, "**/*.java");
            JamService jam = jamServiceFactory.createService(params);

            {
                CppClassesGenerator script = new CppClassesGenerator();
                script.setJam(jam);
                script.setTargetDir(target + "/src/main/cpp");
View Full Code Here

            String sourceDir = basedir + "/src/main/java";

            System.out.println("Parsing source files in: " + sourceDir);

            JamServiceFactory jamServiceFactory = JamServiceFactory.getInstance();
            JamServiceParams params = jamServiceFactory.createServiceParams();
            File[] dirs = new File[] {
                new File(sourceDir)
            };
            params.includeSourcePattern(dirs, "**/*.java");
            JamService jam = jamServiceFactory.createService(params);

            {
                JavaMarshallingGenerator script = new JavaMarshallingGenerator();
                script.setJam(jam);
                script.setTargetDir(basedir + "/src/main/java");
View Full Code Here

            String sourceDir = source + "/src/main/java";

            System.out.println("Parsing source files in: " + sourceDir);

            JamServiceFactory jamServiceFactory = JamServiceFactory.getInstance();
            JamServiceParams params = jamServiceFactory.createServiceParams();
            File[] dirs = new File[] {
                new File(sourceDir)
            };
            params.includeSourcePattern(dirs, "**/*.java");
            JamService jam = jamServiceFactory.createService(params);

            {
                CHeadersGenerator script = new CHeadersGenerator();
                script.setJam(jam);
                script.setTargetDir(target + "/src/libopenwire");
View Full Code Here

                   ClassLoader classLoader =
                           Utils.getClassLoader(configCtx.getAxisConfiguration().getSystemClassLoader(), parentFile);
                    Thread.currentThread().setContextClassLoader(classLoader);
                    String className = file.getName();
                    className = className.replaceAll(".class", "");
                    JamServiceFactory factory = JamServiceFactory.getInstance();
                    JamServiceParams jam_service_parms = factory.createServiceParams();
                    jam_service_parms.addClassLoader(classLoader);
                    jam_service_parms.includeClass(className);
                    JamService service = factory.createService(jam_service_parms);
                    JamClassIterator jClassIter = service.getClasses();
                    while (jClassIter.hasNext()) {
                        JClass jclass = (JClass) jClassIter.next();
                        if (jclass.getQualifiedName().equals(className)) {
                            /**
                             * Schema genertaion done in two stage 1. Load all the methods and
                             * create type for methods parameters (if the parameters are Bean
                             * then it will create Complex types for those , and if the
                             * parameters are simple type which decribe in SimpleTypeTable
                             * nothing will happen) 2. In the next stage for all the methods
                             * messages and port types will be creteated
                             */
                            JAnnotation annotation =
                                    jclass.getAnnotation(AnnotationConstants.WEB_SERVICE);
                            if (annotation != null) {
                                Class claxx = Class.forName(
                                        "org.apache.axis2.jaxws.description.DescriptionFactory");
                                Method mthod = claxx.getMethod(
                                        "createAxisService",
                                        new Class[]{Class.class});
                                Class pojoClass = Loader.loadClass(classLoader, className);
                                AxisService axisService =
                                        (AxisService) mthod.invoke(claxx, new Object[]{pojoClass});
                                Utils.fillAxisService(axisService,
                                                      configCtx.getAxisConfiguration(),
                                                      new ArrayList(),
                                                      new ArrayList());
                                axisService.setName(className);
                                setMessageReceivers(axisService);
                                configCtx.getAxisConfiguration().addService(axisService);
                            } else {
                                HashMap messageReciverMap = new HashMap();
                                Class inOnlyMessageReceiver = Loader.loadClass(
                                        "org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver");
                                MessageReceiver messageReceiver =
                                        (MessageReceiver) inOnlyMessageReceiver.newInstance();
                                messageReciverMap.put(
                                        WSDL2Constants.MEP_URI_IN_ONLY,
                                        messageReceiver);
                                Class inoutMessageReceiver = Loader.loadClass(
                                        "org.apache.axis2.rpc.receivers.RPCMessageReceiver");
                                MessageReceiver inOutmessageReceiver =
                                        (MessageReceiver) inoutMessageReceiver.newInstance();
                                messageReciverMap.put(
                                        WSDL2Constants.MEP_URI_IN_OUT,
                                        inOutmessageReceiver);
                                AxisService axisService = AxisService.createService(className,
                                                                                    configCtx.getAxisConfiguration(),
                                                                                    messageReciverMap,
                                                                                    null, null,
                                                                                    classLoader);
                                configCtx.getAxisConfiguration().addService(axisService);
                            }
                        }
                    }
                }

            } else if (".jar".equals(extension)) {
                ArrayList classList;
                FileInputStream fin = null;
                ZipInputStream zin = null;
                try {
                    fin = new FileInputStream(deploymentFileData.getAbsolutePath());
                    zin = new ZipInputStream(fin);
                    ZipEntry entry;
                    classList = new ArrayList();
                    while ((entry = zin.getNextEntry()) != null) {
                        String name = entry.getName();
                        if (name.endsWith(".class")) {
                            classList.add(name);
                        }
                    }
                    zin.close();
                    fin.close();
                } catch (Exception e) {
                    throw new DeploymentException(e);
                } finally {
                    if (zin != null) {
                        zin.close();
                    }
                    if (fin != null) {
                        fin.close();
                    }
                }
                ArrayList axisServiceList = new ArrayList();
                for (int i = 0; i < classList.size(); i++) {
                    String className = (String) classList.get(i);
                    ClassLoader classLoader = Utils.createClassLoader(
                            new URL[]{deploymentFileData.getFile().toURL()},
                            configCtx.getAxisConfiguration().getSystemClassLoader(),
                            true,
                            (File)configCtx.getAxisConfiguration().getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
                    Thread.currentThread().setContextClassLoader(classLoader);
                    className = className.replaceAll(".class", "");
                    className = className.replaceAll("/", ".");
                    JamServiceFactory factory = JamServiceFactory.getInstance();
                    JamServiceParams jam_service_parms = factory.createServiceParams();
                    jam_service_parms.addClassLoader(classLoader);
                    jam_service_parms.includeClass(className);
                    JamService service = factory.createService(jam_service_parms);
                    JamClassIterator jClassIter = service.getClasses();
                    while (jClassIter.hasNext()) {
                        JClass jclass = (JClass) jClassIter.next();
                        if (jclass.getQualifiedName().equals(className)) {
                            /**
 
View Full Code Here

TOP

Related Classes of org.codehaus.jam.JamServiceFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.