Examples of ServiceFactory


Examples of br.com.mystudies.ds.security.ServiceFactory

import br.com.mystudies.ds.service.Service;

public class App{
    public static void main( String[] args ){

      ServiceFactory sf = new ServiceSimpleFactory();

      //--------------------------------------------

      User user = new User();
      user.setGroup(Group.ADMINISTRATORS);

      Service service = sf.getService(user);

      System.out.println(service.execute());


      //----------------------------------------

      user.setGroup(Group.PROGRAMMERS);

      service = sf.getService(user);

      System.out.println(service.execute());


      // --------------------------------------------
View Full Code Here

Examples of com.baulsupp.kolja.util.services.ServiceFactory

  @SuppressWarnings("unchecked")
  public static BeanFactory<TextReport<?>> createReportBuilder() {
    PropertyEditorRegistrar propertyEditorRegistrar = new KoljaPropertyEditorRegistrar();

    ServiceFactory<TextReport<?>> serviceFactory = new ServiceFactory(TextReport.class);
    ScriptReportFactory factory = new ScriptReportFactory(serviceFactory);
    return new BeanBuilder<TextReport<?>>(propertyEditorRegistrar, factory);
  }
View Full Code Here

Examples of com.hp.hpl.jena.gvs.services.ServiceFactory

    try {
      serviceFactoryClass = Class.forName(factoryClassName).asSubclass(ServiceFactory.class);
    } catch (ClassNotFoundException e1) {
      throw new RuntimeException(e1);
    }
    ServiceFactory serviceFactory;
    try {
      serviceFactory = serviceFactoryClass.newInstance();
    } catch (InstantiationException e) {
      throw new RuntimeException(e);
    } catch (IllegalAccessException e) {
      throw new RuntimeException(e);
    }
    Set<Source> trustedSources = getTrustedSources(serviceResource);
    Source identity = new SourceImpl(serviceResource.getRequiredProperty(SERVICES.identity).getResource().getURI());
    trustedSources.add(identity); //trust yourself
    NamedNode configuration = new NamedNodeImpl(serviceResource.getRequiredProperty(SERVICES.configuration).getResource().getURI());
    final Service service  = serviceFactory.getService(store, identity, trustedSources, configuration);
    new Thread() {
      public void run() {
        service.start();
      }
    }.start();
View Full Code Here

Examples of com.sun.star.comp.security.ServiceFactory

    XMultiServiceFactory multiFactory,
    XRegistryKey regKey )
  {
      if (implName.equals( LoginContext.class.getName() ))
    {
      return new ServiceFactory(
        LoginContext.class,
        new String [] { SERVICE_NAME } );
    }
    return null;
  }
View Full Code Here

Examples of javax.xml.rpc.ServiceFactory

      String targetAddress = "http://" + getServerHostForURL() + ":8080/ws4ee-jbws309/BasicSecured";

      File wsdlFile = new File("resources/webservice/jbws309/META-INF/wsdl/OrganizationService.wsdl");
      assertTrue("wsdl file exists", wsdlFile.exists());

      ServiceFactory factory = ServiceFactory.newInstance();
      Service service = factory.createService(wsdlFile.toURL(), new QName(nsURI, "OrganizationService"));
      Call call = service.createCall(new QName(nsURI, "BasicSecuredPort"), "getContactInfo");
      call.setTargetEndpointAddress(targetAddress);

      try
      {
View Full Code Here

Examples of javax.xml.rpc.ServiceFactory

            URL wsdlURL = new URL("http://localhost:8000/services/MagicGBall?wsdl");
            String namespaceURI = "http://acme.org/magicGball";
            QName serviceQName = new QName(namespaceURI, "MagicGBallService");
            QName portQName = new QName(namespaceURI, "MagicGBallPort");

            ServiceFactory serviceFactory = ServiceFactory.newInstance();
            Service service = serviceFactory.createService(wsdlURL, serviceQName);
            MagicGBallEndpoint mGball = (MagicGBallEndpoint) service.getPort(portQName, MagicGBallEndpoint.class);

            for (int i = 0; i < args.length; i++) {
                String question = args[i];
                String answer = mGball.ask(question);
View Full Code Here

Examples of javax.xml.rpc.ServiceFactory

            // ClassLoader
            ClassLoader tcl =
                Thread.currentThread().getContextClassLoader();
            if (tcl == null)
                tcl = this.getClass().getClassLoader();
            ServiceFactory factory = ServiceFactory.newInstance();
            javax.xml.rpc.Service service = null;

            // Service Interface
            RefAddr tmp = ref.get(ServiceRef.SERVICE_INTERFACE);
            String serviceInterface = null;
            if (tmp != null)
                serviceInterface = (String) tmp.getContent();

            // WSDL
            tmp = ref.get(ServiceRef.WSDL);
            String wsdlRefAddr = null;
            if (tmp != null)
                wsdlRefAddr = (String) tmp.getContent();

            // PortComponent
            Hashtable<String,QName> portComponentRef =
                new Hashtable<String,QName>();

            // Create QName object
            QName serviceQname = null;
            tmp = ref.get(ServiceRef.SERVICE_LOCAL_PART);
            if (tmp != null) {
                String serviceLocalPart = (String) tmp.getContent();
                tmp = ref.get(ServiceRef.SERVICE_NAMESPACE);
                if (tmp == null) {
                    serviceQname = new QName(serviceLocalPart);
                } else {
                    String serviceNamespace = (String) tmp.getContent();
                    serviceQname = new QName(serviceNamespace,
                            serviceLocalPart);
                }
            }
            Class<?> serviceInterfaceClass = null;

            // Create service object
            if (serviceInterface == null) {
                if (serviceQname == null) {
                    throw new NamingException
                    ("Could not create service-ref instance");
                }
                try {
                    if (wsdlRefAddr == null) {
                        service = factory.createService( serviceQname );
                    } else {
                        service = factory.createService( new URL(wsdlRefAddr),
                                serviceQname );
                    }
                } catch (Exception e) {
                    NamingException ex = new NamingException
                    ("Could not create service");
                    ex.initCause(e);
                    throw ex;
                }
            } else {
                // Loading service Interface
                try {
                    serviceInterfaceClass = tcl.loadClass(serviceInterface);
                } catch(ClassNotFoundException e) {
                    NamingException ex = new NamingException
                    ("Could not load service Interface");
                    ex.initCause(e);
                    throw ex;
                }
                if (serviceInterfaceClass == null) {
                    throw new NamingException
                    ("Could not load service Interface");
                }
                try {
                    if (wsdlRefAddr == null) {
                        if (!Service.class.isAssignableFrom(serviceInterfaceClass)) {
                            throw new NamingException
                            ("service Interface should extend javax.xml.rpc.Service");
                        }
                        service = factory.loadService( serviceInterfaceClass );
                    } else {
                        service = factory.loadService( new URL(wsdlRefAddr),
                                serviceInterfaceClass,
                                new Properties() );
                    }
                } catch (Exception e) {
                    NamingException ex = new NamingException
View Full Code Here

Examples of javax.xml.rpc.ServiceFactory

            URL wsdlURL = new URL("http://localhost:8000/services/MagicGBall?wsdl");
            String namespaceURI = "http://acme.org/magicGball";
            QName serviceQName = new QName(namespaceURI, "MagicGBallService");
            QName portQName = new QName(namespaceURI, "MagicGBallPort");

            ServiceFactory serviceFactory = ServiceFactory.newInstance();
            Service service = serviceFactory.createService(wsdlURL, serviceQName);
            MagicGBallEndpoint mGball = (MagicGBallEndpoint) service.getPort(portQName, MagicGBallEndpoint.class);

            for (int i = 0; i < args.length; i++) {
                String question = args[i];
                String answer = mGball.ask(question);
View Full Code Here

Examples of javax.xml.rpc.ServiceFactory

    logger.info("Address used: " + address);
    logger.info("If this address is not correct, use 'setAddress()' to change it.");
    try
      {
          // creation of a Call object for the communication
          ServiceFactory serviceFactory = ServiceFactory.newInstance();
          Service service = serviceFactory.createService(new QName(webServicesName));
          call = (Call) service.createCall();
     
          // address of the service
          call.setTargetEndpointAddress(address);
      }
View Full Code Here

Examples of loci.common.services.ServiceFactory

    Location mdb = new Location(mdbFile).getAbsoluteFile();
    Location parent = mdb.getParentFile();

    MDBService mdbService = null;
    try {
      ServiceFactory factory = new ServiceFactory();
      mdbService = factory.getInstance(MDBService.class);
    }
    catch (DependencyException de) {
      throw new FormatException("MDB Tools Java library not found", de);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.