Permalink
Browse files

changes the name of the project to "closerl"

  • Loading branch information...
videlalvaro committed Aug 8, 2010
1 parent 0b94bf0 commit 726550dd87b13c53dbbac7a7e70deb1d7ecf7004
Showing with 34 additions and 10 deletions.
  1. +1 −1 project.clj
  2. +31 −7 src/erlang/core.clj
  3. +2 −2 test/erlang/core_test.clj
View
@@ -1,4 +1,4 @@
-(defproject erlang "1.0.0-SNAPSHOT"
+(defproject closerl "1.0.0-SNAPSHOT"
:description "FIXME: write"
:dependencies [[org.clojure/clojure "1.1.0"]
[org.clojure/clojure-contrib "1.1.0"]])
View
@@ -1,11 +1,12 @@
-(ns erlang.core
+(ns closerl.core
(:import (com.ericsson.otp.erlang
OtpNode
OtpSelf
OtpErlangList
OtpErlangObject
OtpPeer)))
+;; OtpNode wrapper
(defn otp-node
"Creates an OtpNode"
[node-name]
@@ -29,22 +30,45 @@
[node remote tmo]
(.ping node remote tmo))
+;; OtpSelf wrapper
(defn otp-self
"Creates OtpSelf with name & cookie"
([node-name]
(OtpSelf. node-name))
([node-name cookie]
- (OtpSelf. node-name cookie)))
+ (OtpSelf. node-name cookie))
+ ([node-name cookie port]
+ (OtpSelf. node-name cookie port)))
+
+(defn otp-accept
+ "Accept an incoming connection from a remote node."
+ [s]
+ (.accept s))
+(defn otp-connect
+ "Open a connection to a remote node."
+ [s peer]
+ (.connect s peer))
+
+(defn otp-pid
+ "Get the Erlang PID that will be used as the sender id in all 'anonymous' messages sent by this node."
+ [s]
+ (.pid s))
+
+(defn otp-publish-port
+ "Make public the information needed by remote nodes that may wish to connect to this one."
+ [s]
+ (.publishPort s))
+
+(defn otp-unpublish-port
+ "Unregister the server node's name and port number from the Erlang port mapper, thus preventing any new connections from remote nodes."
+ [s]
+ (.unPublishPort s))
+
(defn otp-peer
"Initializes peer"
[name]
(OtpPeer. name))
-
-(defn connect
- "Connects to Erlang node"
- [s peer]
- (.connect s peer))
(defn otp-rpc-call
"Performs a RPC call to remote node"
@@ -1,5 +1,5 @@
-(ns erlang.core-test
- (:use [erlang.core] :reload-all)
+(ns closerl.core-test
+ (:use [closerl.core] :reload-all)
(:use [clojure.test]))
(deftest replace-me ;; FIXME: write

0 comments on commit 726550d

Please sign in to comment.