Giter Site home page Giter Site logo

oubidar-abderrahim / remotecommand Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iandarwin/remotecommand

0.0 1.0 0.0 13 KB

Simple example of Command pattern over remote connection (RMI).

License: BSD 2-Clause "Simplified" License

Java 93.50% Shell 6.50%

remotecommand's Introduction

remotecommand: Command Pattern over RMI

Because we want our Command to include Java bytecode, we use RMI rather than a web service. Not that we couldn’t use a web service at all, but it’s just easier with RMI. If you’re totally out of the loop on RMI, please check out my free RMI tutorial.

This repo has two separate projects, server and client, each configured both for Maven and Eclipse. After you’ve cloned this repo, here’s how to get it going. Instructions are for *Nix-based systems; for MS-DOS-based systems you’ll have to do a bit of translation of commands and shell scripts, but it ain’t rocket science.

Note that the "common" code is in the server, so the server class files have to be available to compile the client. Hence, the order you do things in matters. In Maven we install the client code into your personal Maven repository. In Eclipse we make the client project depend on the server project.

HowTo: Maven/Command Line

cd server; mvn package install // client depends on server code
./runserver &		// script looks after running rmiregistry
cd ..
cd client; mvn package
./runclient

HowTo: Eclipse

Create server project

  • File→New Java Project

  • Click OFF "Use default location".

  • Set name to "remotecommand-server" (this name’s important as the client project depends on it)

  • Navigate to git repo, single click on server, click Open button.

  • Click Finish.

Create client project

  • File→New Java Project

  • Click OFF "Use default location".

  • Set name to "remotecommand-client" (this name’s less important but why not keep these two projects together in your projects list)

  • Navigate to git repo, single click on client, click Open button.

  • Click Finish.

You can then manually run the RMI registry in another window, run the server’s main program, and run the client’s main program, and see the interaction.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.