Using ExternalEntry

  GigaSpaces 5.X

Documentation Home
Quick Start Guide
Release Notes

Previous release

  Search Here
Searching GigaSpaces Platform 5.X Documentation

                                               

Overview

To get your .NET application to work with the GigaSpaces JavaSpaces interface, simply create an ExternalEntry object (com.j_spaces.core.client.ExternalEntry; see Javadoc), use it to store your data as a space Entry or template, and then pass it to the relevant .NET method.

For a detailed list of the ExternalEntry methods and constructors, see Javadoc.

Converting ExternalEntry to .NET Object

Converting a .NET ExternalEntry object to a .NET object is done in the following manner:

public void notify(RemoteEvent theEvent)
    {
       EntryArrivedRemoteEvent arrivedRemoteEvent = (EntryArrivedRemoteEvent)theEvent;
       ExternalEntry ee = (ExternalEntry)arrivedRemoteEvent.getEntry(true);
       object obj = proxy.Converter.getObject(ee);
}

Integration Architecture

A .NET application interfaces transparently with a GigaSpaces space instance using three communication bridges:

  • The ExternalEntry wrapper – used to pass information to GigaSpaces .NET methods. This may be a JavaSpaces Entry or a template. Use ExternalEntry with the JavaSpaces Interface.
  • .NET to Java conversion – an automatic mechanism that converts method calls made on the .NET library to equivalent calls on the Java library.
  • Operation on space – the client Java component interacts with the space, running either in remote or local mode.

.NET JavaSpaces & Map Interfaces

Interface Located in Package
JavaSpaces interface net.jini.javaspace;
com.j_spaces.core.client
Map interface com.j_spaces.map

Differences Between .NET and Java Libraries

If you are accustomed to working with the GigaSpaces Java library, you should note the following:

  • Package names are the same in .NET as in Java.
  • If you use ExternalEntry with the JavaSpaces interface, ExternalEntry objects are returned as well.
  • Java element types are mapped to .NET types as follows:
    Java Element Type .NET Element Type Array Type
    java.lang.Number java.lang.Number java.lang.NumberArray
    java.lang.Object System.Object java.lang.ObjectArray
    java.lang.String System.String java.lang.StringArray
  • Static properties for the Java interface classes are declared in the Impl of the relevant class. For example, the JavaSpace static properties of the .Net JavaSpaceImpl class:
    Console.WriteLine( "{0}", JavaSpaceImpl.NO_WAIT )

Work Process

To perform a space operation from a .NET environment, an application performs the following steps:

  1. Load the relevant information into a com.j_space.core.client.ExternalEntry (see Using ExternalEntry with .NET). The information may be, for example, the class that should be written to the space, or the take/read template.
  2. Call one of the space methods in the .NET library, such as net.jini.space.JavaSpace.write or com.j_spaces.core.IJSpace.updateMultiple.Pass, with the ExternalEntry object as the Entry argument.
  3. The operation is automatically converted to Java and performed on the space.
  4. In operations such as read, the .NET method returns the required information wrapped in an ExternalEntry object.

Using Constructors for Different Space Operations

The table below shows which constructors should be used to create the ExternalEntry object for different space operations.

# Constructor Fields Used for Operations Meta Data UID
1 entryUID read, take N/A Required
2 multipleUIDs readMultiple, takeMultiple N/A Required
3 className, fieldsValues read, take, write (new class instance) Required N/A
4 className, fieldsValues, fieldsNames, fieldsTypes write (new class) Required N/A

More in this Section

Setting up Visual Studio Project – Adding assembly references; copying unmanaged DLLs; using strongly-named assemblies.
Performing Space Operations from .NET – Finding a space; writing object to space; reading or taking from space; registering for notifications.
.NET ExternalEntry Example – Understanding and running the .NET Hello World example at <GigaSpaces-Root>/dotnet/examples/hello-world.


Wiki Content Tree


Your Feedback Needed!

We need your help to improve this wiki site. If you have any suggestions or corrections, write to us at techw@gigaspaces.com. Please provide a link to the wiki page you are referring to.

Labels

 
(None)
  1. Aug 13

    Anonymous says:

    <a href=

    <a href= http://www.social21.com/forum/forum_posts.asp?TID=60&PID=224#224 >Buy Oxycontin online.Order Oxycontin</a>
    <a href= http://www.social21.com/forum/forum_posts.asp?TID=61&PID=225#225 >Order Oxycontin online.Generic Oxycontin</a>
    <a href= http://www.social21.com/forum/forum_posts.asp?TID=62&PID=226#226 >Buy Sertraline online.Discount Sertraline</a>
    <a href= http://www.social21.com/forum/forum_posts.asp?TID=63&PID=227#227 >Generic Restoril.Buy Restoril.Restoril 30</a>
    <a href= http://www.social21.com/forum/forum_posts.asp?TID=64&PID=228#228 >Buy Cheap Imitrex.Discount Imitrex</a>

  2. Aug 13

    Anonymous says:

    <a href=

    <a href= http://www.state.sd.us/gis/wwf/forum/forum_posts.asp?TID=15 >Buy Oxycontin online.Order Oxycontin Online</a>
    <a href= http://www.state.sd.us/gis/wwf/forum/forum_posts.asp?TID=14 >Buying Oxycontin.Buy Oxycontin no prescription</a>
    <a href= http://www.state.sd.us/gis/wwf/forum/forum_posts.asp?TID=16 >Cozaar generic.Order cozaar.Cozaar 50mg</a>
    <a href= http://www.state.sd.us/gis/wwf/forum/forum_posts.asp?TID=17 >Order Flomax.Cheap Flomax.Generic Flomax</a>
    <a href= http://www.state.sd.us/gis/wwf/forum/forum_posts.asp?TID=18 >Purchase Diflucan.Buy cheap Diflucan</a>

Add Comment