Package org.osoa.sca

Examples of org.osoa.sca.CompositeContext


     */
    public static void main(String[] args) {
        try {
            HelloWorldRmiClient rmiClient = new HelloWorldRmiClient();
                       
            CompositeContext context = CurrentCompositeContext.getContext();
            HelloWorldService helloWorldService = context.locateService(HelloWorldService.class, "HelloWorldServiceComponent");
            System.out.println("***********************************************************");
            System.out.println(helloWorldService.sayHello("SCA RMI Client"));
            System.out.println("***********************************************************");
        } catch ( Exception e ) {
            e.printStackTrace();
View Full Code Here


* locate the HelloWorld service and invoke it.
*/
public class HelloWorldClient {

    public  final static void main(String[] args) throws Exception {
        CompositeContext compositeContext = CurrentCompositeContext.getContext();
        HelloWorldService helloWorldService= compositeContext.locateService(HelloWorldService.class, "HelloWorldServiceComponent");
        String value = helloWorldService.getGreetings("World");
        System.out.println(value);
    }
View Full Code Here

        mId = pId;
    }

    @Override
    public int doStartTag() throws JspException {
        CompositeContext moduleContext = CurrentCompositeContext.getContext();

        Object service = moduleContext.locateService(Object.class, mName);

        if (service == null) {
            throw new JspException("Service [" + mName + "] not found in current module context");
        }
        if (mId == null) {
View Full Code Here

    public int doStartTag() throws JspException {
        if (mProfile == null || mProfile.length() < 1) {
            throw new JspException("Invalid profile location specified");
        }

        CompositeContext moduleContext = CurrentCompositeContext.getContext();

        ProfileService profile = moduleContext.locateService(ProfileService.class, mProfile);

        if (profile == null) {
            throw new JspException("Profile [" + mProfile + "] not found in current module context");
        }
View Full Code Here

    private Iterator mIterator;

    @Override
    public int doStartTag() throws JspException {
        CompositeContext moduleContext = CurrentCompositeContext.getContext();

        ProfileService profile = moduleContext.locateService(ProfileService.class, mProfileService);

        if (profile == null) {
            throw new JspException("Profile [" + mProfileService + "] not found in current module context");
        }

        AccountService service = (AccountService) moduleContext.locateService(AccountService.class, mAccountService);
        if (service == null) {
            throw new JspException("Service [" + mAccountService + "] not found in current module context");
        }
        List entries;
        try {
View Full Code Here

    private Iterator mIterator;

    @Override
    public int doStartTag() throws JspException {
        CompositeContext moduleContext = CurrentCompositeContext.getContext();

        ProfileService profile = moduleContext.locateService(ProfileService.class, mProfileService);

        if (profile == null) {
            throw new JspException("Profile [" + mProfileService + "] not found in current module context");
        }

        AccountService service = (AccountService) moduleContext.locateService(AccountService.class, mAccountService);

        if (service == null) {
            throw new JspException("Service [" + mAccountService + "] not found in current module context");
        }
        List summaries;
View Full Code Here

    private void testCalcCombo(String args[]) {
        System.out.println("\n\n***************************************");
        System.out.println("Starting the Calculator Combo sample!!!");
        System.out.println("***************************************");
        CompositeContext context = CurrentCompositeContext.getContext();
        CalculatorService calculatorService =
            (CalculatorService)context.locateService(CalculatorService.class, "CalculatorServiceComponent");
        System.out.println("\nInvoking Java Implementation ... ");
        System.out.println((new StringBuilder()).append("3 + 2 = ").append(calculatorService.add(3D, 2D))
            .toString());
        System.out.println("\nInvoking Ruby Implementation ... ");
        System.out.println((new StringBuilder()).append("3 - 2 = ")
            .append(calculatorService.subtract(3D, 2D)).toString());
        System.out.println("\nInvoking over RMI Reference... ");
        System.out.println((new StringBuilder()).append("3 * 2 = ")
            .append(calculatorService.multiply(3D, 2D)).toString());
        System.out.println("\nInvoking WebService Implementation ... ");
        System.out.println((new StringBuilder()).append("3 / 2 = ").append(calculatorService.divide(3D, 2D))
            .toString());
        System.out.println("\nInvoking Scientific Calculator Composite Implementation ... ");
        SciCalculatorService sciCalculator =
            (SciCalculatorService)context.locateService(SciCalculatorService.class, "sciCalculatorService");
        double values[] = {1.0D, 2D, 3D, 4D, 5D, 6D, 7D, 8D, 9D};
        System.out.println("\tInvoking Java Implementation  ... ");
        System.out.println((new StringBuilder()).append("\tAverage of 1,2,3,4,5,6,7,8,9 = ")
            .append(sciCalculator.average(values)).toString());
        System.out.println("\n\tInvoking JavaScript Implementation  ... ");
View Full Code Here

    protected void setUp() throws Exception {
        setApplicationSCDL(Source.class, "META-INF/sca/default.scdl");
        super.setUp();

        CompositeContext context = CurrentCompositeContext.getContext();
        source = context.locateService(Source.class, "SourceComponent");
    }
View Full Code Here

*/
public class SimpleCallbackClient {

    public static void main(String[] args) throws Exception {
        // Locate the MyClient component and invoke it
        CompositeContext context = CurrentCompositeContext.getContext();
        MyClient myClient = context.locateService(MyClient.class, "MyClientComponent");
        System.out.println("Main thread " + Thread.currentThread());
        myClient.aClientMethod();
        Thread.sleep(500);
    }
View Full Code Here

        URL base = getClass().getResource("/META-INF/sca/binding.axis2.scdl");
        addExtension("binding.ws", new URL(base, "default.scdl"));
        base = getClass().getResource("/META-INF/sca/databinding.sdo.scdl");
        addExtension("databindning.sdo", new URL(base, "default.scdl"));
        super.setUp();
        CompositeContext compositeContext = CurrentCompositeContext.getContext();
        helloWorldService = compositeContext.locateService(HelloWorldService.class, "HelloWorldServiceComponent");
    }
View Full Code Here

TOP

Related Classes of org.osoa.sca.CompositeContext

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.