Package org.gradle.messaging.remote

Examples of org.gradle.messaging.remote.MessagingClient


        this.displayName = displayName;
        this.serverAddress = serverAddress;
    }

    public void execute(final WorkerContext workerContext) {
        final MessagingClient client = createClient();
        try {
            LOGGER.debug("Starting {}.", displayName);
            WorkerProcessContext context = new WorkerProcessContext() {
                public ObjectConnection getServerConnection() {
                    return client.getConnection();
                }

                public ClassLoader getApplicationClassLoader() {
                    return workerContext.getApplicationClassLoader();
                }

                public Object getWorkerId() {
                    return workerId;
                }

                public String getDisplayName() {
                    return displayName;
                }
            };

            ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
            Thread.currentThread().setContextClassLoader(action.getClass().getClassLoader());
            try {
                action.execute(context);
            } finally {
                Thread.currentThread().setContextClassLoader(contextClassLoader);
            }
            LOGGER.debug("Completed {}.", displayName);
        } finally {
            LOGGER.debug("Stopping client connection.");
            client.stop();
        }
    }
View Full Code Here


    }

    public void execute(final WorkerContext workerContext) {
        MessagingServices messagingServices = createClient();
        try {
            final MessagingClient client = messagingServices.get(MessagingClient.class);
            final ObjectConnection clientConnection = client.getConnection(serverAddress);
            try {
                LOGGER.debug("Starting {}.", displayName);
                WorkerProcessContext context = new WorkerProcessContext() {
                    public ObjectConnection getServerConnection() {
                        return clientConnection;
View Full Code Here

TOP

Related Classes of org.gradle.messaging.remote.MessagingClient

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.