Examples of ProxyTrustInvocationHandler


Examples of net.jini.security.proxytrust.ProxyTrustInvocationHandler

     */
    public ProxyTrustInvocationHandler createPTIH(RemoteMethodControl main,
                                                  ProxyTrust boot) {
        logger.fine("Creating ProxyTrustInvocationHandler[main = "
                + main + ", boot = " + boot + "]");
        return new ProxyTrustInvocationHandler(main, boot);
    }
View Full Code Here

Examples of net.jini.security.proxytrust.ProxyTrustInvocationHandler

        // PASS
        logger.fine("Returned by 'export' method result is defined in "
                + "the same class loader as proxy produced by "
                + "ValidMainExporter's 'export' method as expected.");
        ProxyTrustInvocationHandler ptih = new ProxyTrustInvocationHandler(
                (RemoteMethodControl) me.getProxy(),
                (ProxyTrust) be.getProxy());

        if (!ptih.equals(Proxy.getInvocationHandler(res))) {
            // FAIL
            throw new TestException(
                    "Returned by 'export' method result does not contain "
                    + "ProxyTrustInvocationHandler instance created with "
                    + "main proxy and bootstrap proxy.");
View Full Code Here

Examples of net.jini.security.proxytrust.ProxyTrustInvocationHandler

     *
     */
    public void run() throws Exception {
        RemoteMethodControl main = createValidMainProxy();
        ProxyTrust boot = createValidBootProxy();
        ProxyTrustInvocationHandler ptih = createPTIH(main, boot);
        Object proxy = ProxyTrustUtil.newProxyInstance(
                new Interface1Impl(), ptih);
        Method m = Object.class.getDeclaredMethod("equals",
                new Class[] { Object.class });
        TestClassLoader cl = new TestClassLoader();
View Full Code Here

Examples of net.jini.security.proxytrust.ProxyTrustInvocationHandler

    public void run() throws Exception {
        RMCTEImpl mImpl = new RMCTEImpl();
        RemoteMethodControl main = (RemoteMethodControl)
                ProxyTrustUtil.newProxyInstance(mImpl);
        ProxyTrust boot = createValidBootProxy();
        ProxyTrustInvocationHandler ptih = createPTIH(main, boot);
        Object proxy = ProxyTrustUtil.newProxyInstance(
                new RMCTEImpl(), ptih);
        Method m = RemoteMethodControl.class.getDeclaredMethod(
                "setConstraints", new Class[] { MethodConstraints.class });
        MethodConstraints mc = new BasicMethodConstraints(
View Full Code Here

Examples of net.jini.security.proxytrust.ProxyTrustInvocationHandler

     *
     */
    public void run() throws Exception {
        RemoteMethodControl main = createValidMainProxy();
        ProxyTrust boot = createValidBootProxy();
        ProxyTrustInvocationHandler ptih = createPTIH(main, boot);
        Object proxy = ProxyTrustUtil.newProxyInstance(
                new Interface1TEImpl(), ptih);
        Method m = TrustEquivalence.class.getDeclaredMethod(
                "checkTrustEquivalence", new Class[] { Object.class });
        TestClassLoader cl = new TestClassLoader();
View Full Code Here

Examples of net.jini.security.proxytrust.ProxyTrustInvocationHandler

    /**
     * This method performs all actions mentioned in class description.
     *
     */
    public void run() throws Exception {
        ProxyTrustInvocationHandler ptih = createPTIH(
                newMainProxy(new Interface1RMCTEImpl()),
                newBootProxy(new Interface2RMCPTTEImpl()));
        InvocationHandler[] ih = new InvocationHandler [] {
            new InvHandler(new Interface1RMCTEImpl()),
            createPTIH(newMainProxy(new Interface3RMCTEImpl()),
View Full Code Here

Examples of net.jini.security.proxytrust.ProxyTrustInvocationHandler

     *
     */
    public void run() throws Exception {
        RemoteMethodControl main = createValidMainProxy();
        ProxyTrust boot = createValidBootProxy();
        ProxyTrustInvocationHandler ptih = createPTIH(main, boot);
        Method m = ProxyTrustInvocationHandler.class.getDeclaredMethod(
                "getProxyTrustIterator", new Class[0]);
        m.setAccessible(true);
        ProxyTrustIterator res = (ProxyTrustIterator) m.invoke(ptih, null);

View Full Code Here

Examples of net.jini.security.proxytrust.ProxyTrustInvocationHandler

     *
     */
    public void run() throws Exception {
        RemoteMethodControl main = createValidMainProxy();
        ProxyTrust boot = createValidBootProxy();
        ProxyTrustInvocationHandler ptih = createPTIH(main, boot);
        Object proxy = ProxyTrustUtil.newProxyInstance(new NPIImpl(), ptih);
        Method m = NonPublicInterface.class.getDeclaredMethod(
                "test", new Class[0]);
        Object res = null;

        try {
            ptihInvoke(ptih, proxy, m, null);

            // FAIL
            throw new TestException(
                    "'invoke' invocation of ProxyTrustInvocationHandler "
                    + "did not throw any exception while "
                    + "IllegalArgumentException was expected.");
        } catch (IllegalArgumentException iae) {
            // PASS
            logger.fine("'invoke' invocation of "
                    + "ProxyTrustInvocationHandler threw " + iae
                    + " as expected.");
        }
        proxy = new RMCImpl();
        m = RemoteMethodControl.class.getDeclaredMethod(
                "setConstraints", new Class[] { MethodConstraints.class });
        MethodConstraints mc = new BasicMethodConstraints(
                new InvocationConstraints(
                    new InvocationConstraint[] { ClientAuthentication.YES },
                    null));

        try {
            ptihInvoke(ptih, proxy, m, new Object[] { mc });

            // FAIL
            throw new TestException(
                    "'invoke' invocation of ProxyTrustInvocationHandler "
                    + "did not throw any exception while "
                    + "some kind of exception was expected.");
        } catch (Exception e) {
            // PASS
            logger.fine("'invoke' invocation of "
                    + "ProxyTrustInvocationHandler threw " + e
                    + " as expected.");
        }
        proxy = ProxyTrustUtil.newProxyInstance(new RMCImpl(),
                new ProxyTrustInvocationHandler(main, boot));

        try {
            ptihInvoke(ptih, proxy, m, new Object[] { mc });

            // FAIL
View Full Code Here

Examples of net.jini.security.proxytrust.ProxyTrustInvocationHandler

     *
     */
    public void run() throws Exception {
        RemoteMethodControl main = newMainProxy(new Interface1RMCTEImpl());
        ProxyTrust boot = newBootProxy(new Interface2RMCPTTEImpl());
        ProxyTrustInvocationHandler ptih = createPTIH(main, boot);
        InvocationHandler[] ih = new InvocationHandler [] {
            ptih,
            createPTIH(main,
                       newBootProxy(new Interface2RMCPTTEImpl())),
            createPTIH(newMainProxy(new Interface1RMCTEImpl()),
View Full Code Here

Examples of net.jini.security.proxytrust.ProxyTrustInvocationHandler

     *
     */
    public void run() throws Exception {
        RemoteMethodControl main = new RMCTEImpl();
        ProxyTrust boot = new RMCPTTEImpl();
        ProxyTrustInvocationHandler ptih = createPTIH(main, boot);
        MarshalledObject mo = new MarshalledObject(ptih);

        try {
            mo.get();

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.