Coder Social home page Coder Social logo

librarymanagementsystem's Introduction

LibraryServer

Java RMI practice


RMIBasic

The basic RMI practice

How to run?

server side

  • Place ComputingService.java, ComputingServiceImpl.java and RMIServer.java in the server.
  • use javac to compile them
    javac ComputingService.java
    javac ComputingServiceImpl.java
    javac RMIServer.java
  • run it
    java RMIServer
  • if the default port 1099 is occupied, change it to an another port. In the 23rd line of RMIServer.java, then recomplie them and run.
    // open RMIRegistry
    LocateRegistry.createRegistry(1099);

client side

  • Place ComputingService.java and RMIClient.java in client
  • if your server and client isn't the same computer, change the "localhost" in 16th line of RMIClient.java to the ip address of your server
    // get register from localhost:1099(host:port)
    Registry registry = LocateRegistry.getRegistry("localhost", 1099);
  • use javac to compile them
    javac ComputingService.java
    javac RMIClient.java
  • run it and you will see an output 11
    java RMIClient

Note: if you want to run it in a project, please give the two interface file (server and client) a same package name, or you will get an error: no security manager: RMI class loader disabled


Library Management System

A traditional client/server mode library.

What does it look like?

  • Homepage homepage
  • Add a book to library addpage
  • Delete a book from library deletepage
  • Query books from library single result multiple result

How to run?

server side

  • Place LibraryServer in server side
  • Use javac to compile them
    javac service\*.java
    javac LibraryServer.java
  • Run it
    java LibraryServer
  • if the default port 1099 is occupied, change it to an another port in Line 18 of LibraryServer.java, then recompile them.
    // open RMIRegistry
    LocateRegistry.createRegistry(1099);

client side

  • Place LibraryClient in client side
  • If your server and client isn't the same computer, change the "localhost" in line 60 of view.MainController.java to the ip address of your server
    // get register from localhost:1099
    Registry registry = LocateRegistry.getRegistry("localhost", 1099);
  • Use javac to compile them
    javac -encoding utf-8 service\*.java
    javac -encoding utf-8 view\*.java
    javac -encoding utf-8 stage\*.java
  • Run it and you will see the UI window
    java stage.Main

librarymanagementsystem's People

Contributors

littlegreenmouse avatar

Watchers

 avatar

librarymanagementsystem's Issues

Java RMI

take LibraryManagementSystem as an example

  • basic java rmi attempt
    • interface
    • implementation
    • server
    • client
  • library management system
    • interface
    • implementation
    • server
    • client

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.