https://github.com/steffunky/m2gi.javanaise
https://github.com/steffunky/m2gi.javanaise
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/steffunky/m2gi.javanaise
- Owner: steffunky
- Created: 2017-10-02T06:58:50.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-01T20:24:13.000Z (over 8 years ago)
- Last Synced: 2025-01-27T07:42:50.523Z (over 1 year ago)
- Language: Java
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Javanaise
**Version courante :** Javanaise 2.0
**Etat du projet :** Le coordinateur et les clients IRC fonctionnent correctement. La gestion des verrous est transparente pour les programmeurs. Actuellement, l'obtention ou la création de l'objet à placer dans le coordinateur distant est pris en charge par le proxy.
### Installation
#### Compiler le projet
```sh
mkdir build
javac -d build/ $(find ./src -name "*.java")
```
#### Lancement du registre RMI
```sh
cd build
rmiregistry -J-Djava.rmi.server.useCodebaseOnly=false &
```
#### Lancement du coordinateur
```sh
cd build
java jvn.coordinator.Program &
```
#### Lancement du client IRC
```sh
cd build
java irc.Irc &
```
### Exemple d'utilisation
#### Interface ISentence
```java
public interface ISentence
{
@JvnAction(actionType=ActionType.WRITE)
public void write(String text);
@JvnAction(actionType=ActionType.READ)
public String read();
}
```
#### Client IRC
```java
// Obtient ou créer un objet sentence avec la clé RMI "IRC" (objet géré en arrière plan par un JvnObject)
ISentence s = (ISentence) JvnProxy.newInstance(new Sentence(), "IRC");
// Obtient le texte de l'objet Sentence (LockRead réalisé avant invocation, Unlock réalisé après invocation de la méthode "read")
String text = s.read();
// Met à jour le texte de l'objet Sentence (LockWrite avant invocation et Unlock après invocation de la méthode "write")
s.write("Message");
```