Examples of ServiceDefinition


Examples of org.apache.tuscany.spi.model.ServiceDefinition

            new JavaScriptIntrospector(null, new JavaInterfaceProcessorRegistryImpl());
        ComponentType comonentType = introspector.introspectScript(scaConfig, rs.getClassLoader());
        assertNotNull(comonentType);
        Map services = comonentType.getServices();
        assertEquals(1, services.size());
        ServiceDefinition serviceDefinition = (ServiceDefinition) services.values().iterator().next();
        ServiceContract serviceContract = serviceDefinition.getServiceContract();
        assertTrue(serviceContract instanceof JavaServiceContract);
        JavaServiceContract javaServiceContract = (JavaServiceContract) serviceContract;
        assertEquals(HelloWorldService.class, javaServiceContract.getInterfaceClass());
    }
View Full Code Here

Examples of org.apache.tuscany.spi.model.ServiceDefinition

            new JavaScriptIntrospector(wsdlReg, new JavaInterfaceProcessorRegistryImpl());
        ComponentType comonentType = introspector.introspectScript(scaConfig, rs.getClassLoader());
        assertNotNull(comonentType);
        Map services = comonentType.getServices();
        assertEquals(1, services.size());
        ServiceDefinition serviceDefinition = (ServiceDefinition) services.values().iterator().next();
        ServiceContract serviceContract = serviceDefinition.getServiceContract();
        assertTrue(serviceContract instanceof WSDLServiceContract);
        WSDLServiceContract wsdlServiceContract = (WSDLServiceContract) serviceContract;
        assertEquals(new QName("http://helloworld", "HelloWorld"), wsdlServiceContract.getPortType().getQName());
    }
View Full Code Here

Examples of org.apache.tuscany.spi.model.ServiceDefinition

    public void testIntrospectUnannotatedClass() throws ProcessingException {
        CompositeComponent parent = EasyMock.createNiceMock(CompositeComponent.class);
        SystemImplementation impl = new SystemImplementation(BasicInterfaceImpl.class);
        PojoComponentType<?, ?, ?> componentType = loader.loadByIntrospection(parent, impl, null);
        ServiceDefinition service = componentType.getServices().get("BasicInterface");
        assertEquals(BasicInterface.class, service.getServiceContract().getInterfaceClass());
        Property<?> property = componentType.getProperties().get("publicProperty");
        assertEquals(String.class, property.getJavaType());
        ReferenceDefinition referenceDefinition = componentType.getReferences().get("protectedReference");
        assertEquals(BasicInterface.class, referenceDefinition.getServiceContract().getInterfaceClass());
    }
View Full Code Here

Examples of org.apache.tuscany.spi.model.ServiceDefinition

        expect(mockReader.getName()).andReturn(SERVICE).anyTimes();
        expect(mockReader.getAttributeValue(null, "name")).andReturn(name);
        expect(mockReader.next()).andReturn(END_ELEMENT);
        expect(mockReader.getName()).andReturn(SERVICE).anyTimes();
        replay(mockReader);
        ServiceDefinition serviceDefinition = loader.load(null, mockReader, null);
        assertNotNull(serviceDefinition);
        assertEquals(name, serviceDefinition.getName());
    }
View Full Code Here

Examples of org.apache.tuscany.spi.model.ServiceDefinition

        expect(mockReader.getName()).andReturn(SERVICE);

        replay(mockReader);
        replay(mockRegistry);

        ServiceDefinition serviceDefinition = loader.load(null, mockReader, deploymentContext);
        assertNotNull(serviceDefinition);
        assertEquals(name, serviceDefinition.getName());
        assertSame(sc, serviceDefinition.getServiceContract());
    }
View Full Code Here

Examples of org.infoglue.cms.entities.management.ServiceDefinition

    return (ServiceDefinitionVO) getVOWithId(ServiceDefinitionImpl.class, serviceDefinitionId, db);
    }
 
    public ServiceDefinitionVO create(ServiceDefinitionVO vo) throws ConstraintException, SystemException
    {
        ServiceDefinition ent = new ServiceDefinitionImpl();
        ent.setValueObject(vo);
        ent = (ServiceDefinition) createEntity(ent);
        return ent.getValueObject();
    }    
View Full Code Here

Examples of org.infoglue.cms.entities.management.ServiceDefinition

   
        beginTransaction(db);

        try
        {
          ServiceDefinition serviceDefinition = getServiceDefinitionWithId(vo.getServiceDefinitionId(), db);
        if(serviceDefinition.getName().equalsIgnoreCase("Core content service") || serviceDefinition.getName().equalsIgnoreCase("Core structure service"))
        {
          throw new ConstraintException("ServiceDefinition.deleteAction", "3200");
       
        }
        catch(ConstraintException ce)
View Full Code Here

Examples of org.infoglue.cms.entities.management.ServiceDefinition

    public ServiceDefinitionVO update(ServiceDefinitionVO serviceDefinitionVO) throws ConstraintException, SystemException
    {
        Database db = CastorDatabaseService.getDatabase();
        ConstraintExceptionBuffer ceb = new ConstraintExceptionBuffer();

        ServiceDefinition serviceDefinition = null;

        beginTransaction(db);

        try
        {
            //add validation here if needed
            serviceDefinition = getServiceDefinitionWithId(serviceDefinitionVO.getServiceDefinitionId(), db);
            serviceDefinition.setValueObject(serviceDefinitionVO);

            //If any of the validations or setMethods reported an error, we throw them up now before create.
            ceb.throwIfNotEmpty();
           
            commitTransaction(db);
        }
        catch(ConstraintException ce)
        {
            logger.warn("An error occurred so we should not complete the transaction:" + ce, ce);
            rollbackTransaction(db);
            throw ce;
        }
        catch(Exception e)
        {
            logger.error("An error occurred so we should not complete the transaction:" + e, e);
            rollbackTransaction(db);
            throw new SystemException(e.getMessage());
        }


        return serviceDefinition.getValueObject();
    }       
View Full Code Here

Examples of org.infoglue.cms.entities.management.ServiceDefinition

    beginTransaction(db);

    try
    {
      ServiceDefinition serviceDefinition = getServiceDefinitionWithName(name, db, true);
      if(serviceDefinition != null)
        serviceDefinitionVO = serviceDefinition.getValueObject();
     
      commitTransaction(db);
    }
    catch(Exception e)
    {
View Full Code Here

Examples of org.infoglue.cms.entities.management.ServiceDefinition

   * @throws Bug
   */

  public ServiceDefinition getServiceDefinitionWithName(String name, Database db, boolean readOnly) throws SystemException, Bug
  {
    ServiceDefinition serviceDefinition = null;
   
    try
    {
      OQLQuery oql = db.getOQLQuery("SELECT a FROM org.infoglue.cms.entities.management.impl.simple.ServiceDefinitionImpl a WHERE a.name = $1");
      oql.bind(name);
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.