Development

XAP.NET speaks Java?

By |2020-10-07T10:58:53+00:00October 5, 2008|

One of the key features of GigaSpaces XAP/XAP.NET is the seamless interoperability of .NET Java and C++, This can happen because that the product core is developed in Java and entries are saved inside the space in a generic, language free, form, allowing each specific programming language to interact with [...]

The new XAP.NET 6.6 version

By |2020-10-07T10:59:04+00:00October 5, 2008|

XAP.NET 6.6 has been recently released, I’m very happy to introduce this new and very cool version. It’s the first time that XAP.NET is a completely stand alone version. The .msi installation provides a fluent self explanatory installation experience. Once installation is completed you get a fully configured ready to [...]

Scaling-Out Web Application with GigaSpaces XAP. Part I

By |2020-10-11T13:52:47+00:00August 7, 2008|

Overview Building a reliable, automatic scaled-out infrastructure for your web application is not a job for the faint of heart. It often involves deep knowledge of your application servers or getting expert consulting. Sometimes both. GigaSpaces XAP application platform will let you do that, and more, with just a few [...]

Sharing Results of Expensive Computations

By |2020-10-11T14:36:52+00:00March 25, 2008|

A customer recently contacted us to discuss how to use GigaSpaces XAP to minimize the number of times an expensive computation must run. The particular domain is option price stress testing, but the problem is more general and the solution demonstrates a couple of interesting GigaSpaces XAP features. Consider a [...]

New GigaSpaces/OpenSpaces.org Forums

By |2020-10-12T06:43:32+00:00December 17, 2007|

As part of our ongoing effort to build and serve the fast-growing community around GigaSpaces and OpenSpaces.Org , we've re-launched our discussion forums , using Jive Forums. We have migrated all of the posts from the old forums and simplified the forum structure. So please, check them out . The [...]

Agile Development at GigaSpaces

By |2020-10-12T08:38:51+00:00December 6, 2007|

Guy Nirpaz, GigaSpaces ' Executive VP of R&D, writes in his blog about GigaSpaces agile development methodologies using Scrum. Guy writes about best practices, what works and doesn't work and more. Read the full post .

Alternate Script to create projects using ProjectCreator and update to jar

By |2020-10-12T07:27:25+00:00September 5, 2007|

Hi,

I have made a small adjustment to one of the template files in the project-creator.jar. This means that *all* eclipse projects will be generated with a classpath that includes the variable GS_HOME . This variable will point to whatever you (the owner of the running eclipse instance) determines it should point to.

BTW: It needs to point to the home directory for your installation of GigaSpacesXAP6.0

To accomplish this:
1) create the project using projectcreator
2) import the project into eclipse version 3.3 (europa)
3) right-click on the project and select
Build Path | Configure Build Path...
4) select
Add Variable | Configure Variables...
5) select
New...
6) enter the following in the two fields
Name: GS_HOME
Path: [browse_to_the_home_directory_of_your_installation_of_GigaSpacesXAP6.0]
(
On my system, in eclipse I have configured GS_HOME to point to
c:\GigaSpacesXAP6.0
)
7) click OK
8) do a rebuild
9) ignore the warning that the path is not a jar file (we know that already)
10) Find your way back to the project and look: the red x is gone!

The Variable GS_HOME should now be resolved and reusable for future projects in eclipse.

In addition, I noticed mucho redundancy in the scripts I offered in my previous posts.

The eclipse and intellij versions are now identical except for the value provided for the IDE variable.

The following scripts are hopefully clearer alternates you can use to create the various projects:


____________________________
file: createPublisher.cmd
____________________________

rem #### if you are using intellij: before calling this script, configure the following:
rem #### set IDE=-intellij
rem ####

rem This script starts the projectCreator so as to create a PU containing a TimerTask – a SpringBean that gets invoked over and over again by a Timer. Configure how often to do this in the PU.xml Note this is good for a feed or driver and usually means you will elect to have a remote space.

rem In addition: if the IDE is set to -eclipse:
rem ProjectCreator determines that the classpath in the eclipse project uses an eclipse-specific GS_HOME variable in the same way the examples that come with the product do – this makes for a more portable project. Note that the build.xml file created as part of the project will still use an explicit path and will need to be edited if the project is used in a new environment and the ant tasks are invoked.

rem Personal Settings (these change according to each machine environment)
set JAR_FILE_LOCATION=./project-creator.jar
set OUTPUT_DIRECTORY=C:\tmp\projectcreator
set JAVA_HOME=c:\java\jdk1.5.0_07
if "%JSHOMEDIR%." == "." set JSHOMEDIR=c:\GigaSpacesXAP6.0

rem Script-specific Configuration Settings:
set PROJECT_NAME=Publisher
if "%IDE%." == "." set IDE=-eclipse
set SERVICE_TEMPLATE_NAME=service.javasrc_timerTask
set PU_TEMPLATE_NAME=pu.xmlsrc_timerTask

rem General Options
rem elect to overwrite existing projects with same name:
set OVERWRITE_OPTION=-overwrite

call %JAVA_HOME%\bin\java -jar %JAR_FILE_LOCATION% %IDE% %OVERWRITE_OPTION% -project %PROJECT_NAME% -out %OUTPUT_DIRECTORY% -setServiceTemplateName %SERVICE_TEMPLATE_NAME% -setPUTemplateName %PU_TEMPLATE_NAME% -gigaHome %JSHOMEDIR%
____________________________
____________________________
file: createNotifyListener.cmd
____________________________

rem #### if you are using intellij: before calling this script, configure the following:
rem #### set IDE=-intellij
rem ####

rem This script starts the projectCreator so as to create a PU containing a NotifyContainer – a SpringBean with a default method that gets invoked when a matching object appears or is modified in the space. Note this is good for a listener (a take is not performed as part of the NotifyContainer operation) and could be implemented with either a remote or embedded space.
rem In addition: if the IDE is set to -eclipse:
rem ProjectCreator determines that the classpath in the eclipse project uses an eclipse-specific GS_HOME variable in the same way the examples that come with the product do – this makes for a more portable project. Note that the build.xml file created as part of the project will still use an explicit path and will need to be edited if the project is used in a new environment and the ant tasks are invoked.

rem Personal Settings (these change according to each machine environment)
set JAR_FILE_LOCATION=./project-creator.jar
set OUTPUT_DIRECTORY=C:\tmp\projectcreator
set JAVA_HOME=c:\java\jdk1.5.0_07
if "%JSHOMEDIR%." == "." set JSHOMEDIR=c:\GigaSpacesXAP6.0

rem Script-specific Configuration Settings:
set PROJECT_NAME=NotifyListener
if "%IDE%." == "." set IDE=-eclipse
set SERVICE_TEMPLATE_NAME=service.javasrc
set PU_TEMPLATE_NAME=pu.xmlsrc_notifyContainer

rem General Options
rem elect to overwrite existing projects with same name:
set OVERWRITE_OPTION=-overwrite

call %JAVA_HOME%\bin\java -jar %JAR_FILE_LOCATION% %IDE% %OVERWRITE_OPTION% -project %PROJECT_NAME% -out %OUTPUT_DIRECTORY% -setServiceTemplateName %SERVICE_TEMPLATE_NAME% -setPUTemplateName %PU_TEMPLATE_NAME% -gigaHome %JSHOMEDIR%

_______________________________
file: createPollingWorker.cmd
____________________________

rem #### if you are using intellij: before calling this script, configure the following:
rem #### set IDE=-intellij
rem ####

rem This script starts the projectCreator so as to create a PU containing a PollingContainer – a SpringBean with a default method that gets invoked when a matching object appears or is modified in the space. NB: The PollingContainer removes (takes) the interesting information from the Space!
rem Note this is good for a worker and usually means you will elect to have an embedded space.

rem In addition: if the IDE is set to -eclipse:
rem ProjectCreator determines that the classpath in the eclipse project uses an eclipse-specific GS_HOME variable in the same way the examples that come with the product do – this makes for a more portable project. Note that the build.xml file created as part of the project will still use an explicit path and will need to be edited if the project is used in a new environment and the ant tasks are invoked.

rem Personal Settings (these change according to each machine environment)
set JAR_FILE_LOCATION=./project-creator.jar
set OUTPUT_DIRECTORY=C:\tmp\projectcreator
set JAVA_HOME=c:\java\jdk1.5.0_07
if "%JSHOMEDIR%." == "." set JSHOMEDIR=c:\GigaSpacesXAP6.0

rem Script-specific Configuration Settings:
set PROJECT_NAME=PollingWorker
if "%IDE%." == "." set IDE=-eclipse
set SERVICE_TEMPLATE_NAME=service.javasrc
set PU_TEMPLATE_NAME=pu.xmlsrc

rem General Options
rem elect to overwrite existing projects with same name:
set OVERWRITE_OPTION=-overwrite

call %JAVA_HOME%\bin\java -jar %JAR_FILE_LOCATION% %IDE% %OVERWRITE_OPTION% -project %PROJECT_NAME% -out %OUTPUT_DIRECTORY% -setServiceTemplateName %SERVICE_TEMPLATE_NAME% -setPUTemplateName %PU_TEMPLATE_NAME% -gigaHome %JSHOMEDIR%
________________________________

Cheers,

Owen.

ProjectCreator version .0000001 :0) [A hackers utility that creates openspaces projects in eclipse]

By |2020-10-12T07:31:12+00:00August 18, 2007|

Early release of java command-line wizard generates OpenSpaces projects in seconds for rapid development of highly scalable Spring Applications using the GigaSpaces SBA platform. --It works for me :)

OK. Be gentle.

I am biting the bullet and publishing my current release of the wizard I have been working on that generates eclipse projects for OpenSpaces developers. Those who have seen me at various shows and JUGS will know what it does. It certainly saves me time as I get started on new projects, but then I know the code.. ;)

In an attempt to broaden the use of it, I have begun to document my work on it and some of the feedback and future plans I have for it.

Note: this utility will change and hopefully improve in the coming days/weeks etc. There are areas I already plan to improve -not least of all the code implementing it-.

Your feedback is welcome.

It is my sincere wish that somebody will benefit as they begin to explore the OpenSpaces concepts through rapidly generating their first few projects using this tool. Perhaps, more add-ons will be created by those interested in OpenSpaces -- I particularly would love someone to create a front-end wizard for quick web pages backed by the Spring-based OpenSpaces. I think if we put our heads together we can give folks over at ruby on rails a run for their money.
(how's that for inflammatory!)

Here is the first binary release of it - let me know if you want/need the code.

The current state of this unofficial utility is somewhat summed up below:



projectcreator_thoughts

projectcreator_thoughts


NameOfPersonWantingFeature: Feature description

As of 2007-08-17
Completed Features

OwenT: Polling(take)
OwenT: Polling(complex query)
OwenT: Publishing(TimerTask)
PatrickM: clean ant script better
OwenT: Supply a @projectName.launch file in the .eclipse folder in the project directory (this will save a configuration step)

TODO

PatrickM: NotifyContainer
OwenT: Remoting
OwenT: Domain model shared
PatrickM: Randy’s thing
PeterC: readme: how to import, run, deploy Why does this help?
PeterC: whyme?
KevinH: include change to pu.xml templates to point XSD’s to local path
OwenT: Unix scripts to do what the windows scripts do
DennisR: Implement configurable resource bundles to contain templates and corresponding map of
variable names. This will allow much more flexibility for future extensions.
DennisR: Create Unit Tests to ensure nothing gets broken as new features are added

Explanation of basic concepts behind the projectcreator:

Project Creator creates the directory structure, build files, java source files and configuration files necessary to build and deploy an OpenSpaces ProcessingUnit herein thought of as a ‘project’.

To create the proper java, xml, eclipse files and the directory structures necessary, Project Creator uses various templates (stored initially within the projectcreator.jar file) and some variables that are replaced with user-provided values as the project is created.

Within the templates, variables are specified as @variableName

These variables are currently:

@projectName (Name of the project you want to build)
@spaceName (Name of the space you want to connect to ex: MySpace)
@propertySpaceName (Name of the space with a lowercased first letter – derived from @spaceName ex: mySpace)
@varGSHome (Path to [and including] Root Directory of your XAP installation)
@spaceUrl (This is derived from the @spaceName and your choice of remote or embedded)
@packageName (You specify this as the package for your first service in this Project)
@packageDir (This is derived from the @packageName)
@serviceName (You specify this as the name of your service class)
@dataObjectName (You specify this as the name of your data class (note the package name will set to @packageName.common to ensure this class is packaged in a separate jar file for classloading purposes)


@spaceMutator (currently not used, but uses the upperCased first letter version of
@propertySpaceName to derive the setter method Ex: setMySpace)


First Cut: Instructions


The scripts pass args to the projectcreator that are then used to define some of the variables I wrote about as well as discern whether or not to build particularly eclipse-specific files into the project and other similar things.

The args used are:

-eclipse (specifies you want all the eclipse-specific artifacts)
-overwrite (specifies you wish to overwrite any project files in the same directory you are about to specify)
-project test (specifies the project directory name - you are later prompted to change this)
-out c:\wrk\openspaces (specifies the directory into which the -project will go)
-setServiceTemplateName service.javasrc (specifies the java service template file to use - found in the jar file unless otherwise specified)
-setPUTemplateName pu.xmlsrc (specifies the OpenSpaces PU.xml template file to use - found in the jar file unless otherwise specified)
-gigaHomeVar c:\GigaSpacesXAP6.0 (specifies the root directory of your GigaSpaces installation)

Running the java -jar project-creator.jar command with the various args starts an interactive shell wherein you provide the rest of the salient properties pertaining to project creation:

An example: (user feedback is in bold)

***

Welcome to the GigaSpaces Project Creator
To create a new project, please answer the following questions:

What would you like to name your project [test]?
Root directory for project creation [c:\wrk\openspaces]?
Is Space embedded in this PU? [yes]
Name of space [gigaspace]
Package name for ProcessingUnit [com.test]?
ClassName of Service [MyService]?
Name of Data Object []? Message

***

Completing this set of questions causes the project creator to create the files and directories that make it easy to develop and deploy a simple OpenSpaces ProcessingUnit.

For more info on Processing Units and OpenSpaces please look at hello world.

Getting Started: Using the scripts mentioned at the bottom of this post as a guide:

1. Create a polling container to create an embedded (colocated) worker service.


Take note of the Data type you create – this file will need to be copied into any other projects that also use it – note it will use a sub-package called ‘common’ to ensure it can be shared accross processing units (workaround to a well known classloading issue)


Also take note of the spacename you chose – other projects that want to communicate with this one will need to specify the same spacename

2. Create a TaskTimer to create a remote driver or publisher of information.


see the notes above regarding the shared data and spacename

Take note that you specify a remote space with the same name as the other projects with which you want to share info

Once a project is built:

1) import it into Eclipse Europa with the Spring plugin.
2) Configure the build Path so the GS_HOME variable is accurate for your system
3) Edit the generated build.xml file for the project so the gshome.dir property is accurate for your system
4) Add in some simple code to the Service you created System.out.println(“Hi Mom”);—or uncomment the code snippets I provided
5) Right-click on the project, select ‘Run As’ then ‘Open Run Dialog’ if it already has a @projectName.launch file simply select the @projectName under ‘Java Aplication’ and execute ‘Run’ (bottom right-hand of the ‘Run’ window.
Otherwise you need to configure the following:


A) Right-click the ‘Java Application’ branch of the tree in the left-hand pane of the ‘Run’ window.
B) Select ‘New’
C) change the name of the ‘Name’ from ‘New_configuration’ to something project-specific
D) Select the ‘Main class’ textbox and paste in:
org.openspaces.pu.container.integrated.IntegratedProcessingUnitContainer
E) ‘Browse’ to the project for which you are creating this configuration (middle button)
F) ensure that the correct ‘Project’ has been selected and that the above main class is still visible then click ‘Apply’
G) click ‘Run’ to run your project inside the eclipse IDE

Note: You must run the projects with the embedded spaces first! the remote space projects are injected with the space proxy only at startup time and never again!


...


...


Current windows scripts Owen uses:

1) runprojectcreatorPolling_GSHOME.cmd

rem This script starts the projectCreator so as to create a PU containing a PollingContainer – a SpringBean with a default method that gets invoked when a matching object appears or is modified in the space. Note this is good for a worker and usually means you will elect to have an embedded space.

rem In addition: This script specifies that the classpath in the eclipse project uses a GS_HOME variable in the same way the examples that come with the product do – this makes for a more portable project. Note that the build.xml file created as part of the project will still use an explicit path and will need to be edited if the project is used in a new environment and the ant tasks are invoked.

set JAVA_HOME=c:\java\jdk1.5.0_07
call %JAVA_HOME%\bin\java -jar project-creator.jar -eclipse -overwrite -project test -out c:\wrk\openspaces -setServiceTemplateName service.javasrc -setPUTemplateName pu.xmlsrc -gigaHomeVar c:\GigaSpacesXAP6.0

2) runprojectcreatorTaskTimer_GSHOME.cmd

rem This script starts the projectCreator so as to create a PU containing a TimerTask – a SpringBean that gets invoked over and over again by a Timer. Configure how often to do this in the PU.xml Note this is good for a feed or driver and usually means you will elect to have a remote space.

rem In addition: This script specifies that the classpath in the eclipse project uses a GS_HOME variable in the same way the examples that come with the product do – this makes for a more portable project. Note that the build.xml file created as part of the project will still use an explicit path and will need to be edited if the project is used in a new environment and the ant tasks are invoked.

set JAVA_HOME=c:\java\jdk1.5.0_07
call %JAVA_HOME%\bin\java -jar project-creator.jar -eclipse -overwrite -project test -out c:\wrk\openspaces -setServiceTemplateName service.javasrc_timerTask -setPUTemplateName pu.xmlsrc_timerTask -gigaHomeVar c:\GigaSpacesXAP6.0

3) runprojectcreatorComplexPolling_GSHOME.cmd

rem This script starts the projectCreator so as to create a PU containing a PollingContainer – a SpringBean with a default method that gets invoked when a matching object appears or is modified in the space. Note this is good for a worker and usually means you will elect to have an embedded space.

rem In addition: This script uses the templates that provide the framework for complex queries using SQL and REGEX syntax

rem * In addition: This script specifies that the classpath in the eclipse project uses a GS_HOME variable in the same way the examples that come with the product do – this makes for a more portable project. Note that the build.xml file created as part of the project will still use an explicit path and will need to be edited if the project is used in a new environment and the ant tasks are invoked.

set JAVA_HOME=c:\java\jdk1.5.0_07
call %JAVA_HOME%\bin\java -jar project-creator.jar -eclipse -overwrite -project test -out c:\wrk\openspaces -setServiceTemplateName service.javasrc_pollingComplexQuery -setPUTemplateName pu.xmlsrc_pollingComplexQuery -gigaHomeVar c:\GigaSpacesXAP6.0



Cheers,

Owen.