Cajo project
The Cajo Project is a framework that enables multiple Javaapplications that are spread across multiple machines to work together as one transparently and dynamically. This framework is useful for both open/free and proprietary applications that need distributed computing capabilities. It is capable of being used on almost any Java-equipped platform (JRE/JME 1.2 or higher) (mobile phones, mainframes, servers, embedded devices etc.) It is a “drop-in” framework, because it does not impose any structural requirements or source code changes and is 100% pure Java with no XML code. It also is not dependent on any other frameworks and can work behind NAT, firewalls, even HTTPproxies.
History
The Cajo Project has been issued by the IANA port number 1198 and UDP Multicast address 224.0.23.162.
License
The source code is free under the LGPL, and the documentation is free under the GFDL.
Usage
Overview
Using the Cajo Project, ordinary unmodified Java objects, can be remote using a single line of code:[1]
- Itemserver.bind(someObject, "someName")
These can then be used by remote machines either statically, or dynamically.
Static remote object usage
Static remote object usage is typically performed when there are one or more interfaces to the object, defining how the client may use it, known at Compile time. For example:
- public interface SomeInterface { ... // method signatures}
The remote object implements this interface, and possibly others, then remotes the object as shown previously.
Static remote object usage is provided through a TransparentItemProxy.[2] The user of a remote object can create a reference to this object, which actually implements the shared interface, as follows:
- SomeInterface si = (SomeInterface)TransparentItemProxy.getItem("//someHost:1198/someName", new Class[...] {SomeInterface.class} )
A remote machine may now invoke methods on the remote object, with the exact Java syntax and semantics, as if it were local.
Dynamic remote object usage
Dynamic remote object usage is typically performed when the interface to an object will be determined at runtime. This is often the case when using Cajo remote objects in a scripting.[3] A machine dynamically uses a remote object reference as follows:
- // obtain reference
Object object = Remote.getItem("//someHost:1198/someName");
- // يتم الحصول عليها عادةً في وقت التشغيل
String someMethod = "someMethod";
- // يتم الحصول عليها أيضًا في وقت التشغيل
Object someArgs = new Object[...] { someArgs, ... };
- Object result = Remote.invoke(object, someMethod, someArgs);
يستدعي هذا المقتطف البرمجي دالةً على كائن بعيد، ويُمرر الوسائط (إن وجدت) ، ثم يُعيد النتيجة (إن وجدت) .
يُمكّن إطار عمل كاجو الجهاز من الوصول عن بُعد إلى مرجع الكائن الخاص به باستخدام بروتوكول UDP مع البث المتعدد عبر بروتوكول الإنترنت (IP) . [ 4 ] تتيح هذه التقنية للأجهزة الراغبة في استخدام المراجع البعيدة الاستماع ببساطة إلى الإعلانات. وهذا يوفر آلية ربط من نوع واحد إلى متعدد ، حيث لا يحتاج مستخدمو الكائن البعيد إلى معرفة عنوان TCP/IP الخاص بالجهاز المضيف.
واجهات المستخدم الرسومية عن بعد
يُستخدم مشروع Cajo أيضًا لتشغيل واجهات المستخدم الرسومية عن بُعد. [ 5 ] وهذا يسمح للتطبيق بتشغيل عرضه على أجهزة منفصلة عن نموذجه ، وحتى عن كائنات التحكم الخاصة به .
انظر أيضاً
مراجع
- ↑ "إضافة كاجو إلى التطبيقات الحالية" . مشروع كاجو. 4 أغسطس 2007. مؤرشف من الأصل في 25 سبتمبر 2006. تم الاطلاع عليه في 19 يناير 2008 .
- ↑ "استخدام الكائنات البعيدة كما لو كانت محلية" . مشروع كاجو. 4 أغسطس 2007. مؤرشف من الأصل في 23 ديسمبر 2007. تم الاطلاع عليه في 19 يناير 2008 .
- ↑ "لماذا نستخدم لغة كاجو؟" . مشروع كاجو. 4 أغسطس 2007. مؤرشف من الأصل في 3 يناير 2008. تم الاطلاع عليه في 19 يناير 2008 .
- ↑ "استخدام البث المتعدد في كاجو" . مشروع كاجو. 4 أغسطس 2007. مؤرشف من الأصل في 23 ديسمبر 2007. تم الاطلاع عليه في 19 يناير 2008 .
- ↑ "استخدام آلية وكيل كاجو" . مشروع كاجو. 4 أغسطس 2007. مؤرشف من الأصل في 23 ديسمبر 2007. تم الاطلاع عليه في 19 يناير 2008 .
روابط خارجية
- https://web.archive.org/web/20060925101254/https://cajo.dev.java.net/ صفحة مشروع كاجو
- http://java.net/projects/cajo صفحة مشروع Cajo SDK
- إعلان رسمي عن رقم منفذ IANA
- إعلان عنوان البث المتعدد لهيئة IANA
- عناوين البث المتعدد عبر الإنترنت
- جافا (منصة برمجية)
