Search in sources :

Example 1 with CBstring

use of alma.ACS.CBstring in project ACS by ACS-Community.

the class RequesterUtil method giveCBString.

// ========================================================
// =====================  Requests  =======================
// ========================================================
/**
	 * 
	 * @param cs
	 * @param x
	 * @return
	 * @throws AcsJContainerServicesEx
	 */
public static CBstring giveCBString(ContainerServicesBase cs, ResponseReceiver<String> x) throws AcsJContainerServicesEx {
    CBstring ret;
    Objects.CBstringImpl cb = new Objects.CBstringImpl(x);
    OffShoot offshoot = cs.activateOffShoot(cb);
    ret = CBstringHelper.narrow(offshoot);
    return ret;
}
Also used : OffShoot(alma.ACS.OffShoot) CBstring(alma.ACS.CBstring)

Example 2 with CBstring

use of alma.ACS.CBstring in project ACS by ACS-Community.

the class SampleRequester method testA.

public void testA() throws Exception {
    // --- activate callback object
    ResponseReceiver x = new ResponseReceiver() {

        public void incomingResponse(String s) {
            System.out.println("Incoming String: " + s);
        }

        public void incomingResponse(String[] s) {
            System.out.println("Incoming StringArray: " + Arrays.asList(s));
        }

        public void incomingResponse(int s) {
            System.out.println("Incoming int: " + s);
        }

        public void incomingResponse(int[] s) {
            System.out.println("Incoming intArray: " + s.length);
        }

        public void incomingResponse(double s) {
            System.out.println("Incoming double: " + s);
        }

        public void incomingResponse(double[] s) {
            System.out.println("Incoming doubleArray: " + s.length);
        }

        public void incomingResponse(Object s) {
            System.out.println("Incoming Object: " + s);
        }

        public void incomingException(Exception s) {
            System.out.println("Responding failed: " + s);
        }
    };
    CBDescIn descIn = RequesterUtil.giveDescIn();
    logger.info("setting string callback");
    CBstring cb = RequesterUtil.giveCBString(cs, x);
    responder.revertString("Hallo", cb, descIn);
    logger.info("setting string callback again");
    responder.revertString("Welt", cb, descIn);
    logger.info("setting long callback");
    responder.countString("Hallo", RequesterUtil.giveCBLong(cs, x), descIn);
    logger.info("setting long[] callback");
    responder.convertString("Hallo", RequesterUtil.giveCBLongSequence(cs, x), RequesterUtil.giveDescIn());
    logger.info("setting string[] callback");
    responder.dummy1("Hallo", RequesterUtil.giveCBStringSequence(cs, x), RequesterUtil.giveDescIn());
    logger.info("setting double[] callback");
    responder.dummy2("Hallo", RequesterUtil.giveCBDoubleSequence(cs, x), RequesterUtil.giveDescIn());
    logger.info("setting double callback");
    responder.dummy3("Hallo", RequesterUtil.giveCBDouble(cs, x), RequesterUtil.giveDescIn());
}
Also used : CBDescIn(alma.ACS.CBDescIn) CBstring(alma.ACS.CBstring)

Aggregations

CBstring (alma.ACS.CBstring)2 CBDescIn (alma.ACS.CBDescIn)1 OffShoot (alma.ACS.OffShoot)1