/*
* Copyright 2008 GigaSpaces Technologies LTD. All rights reserved.
*
* THIS SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. GIGASPACES WILL NOT
* BE LIABLE FOR ANY DAMAGE OR LOSS IN CONNECTION WITH THE SOFTWARE.
*/
package com.gigaspaces.examples.tutorials.queries.codebasedfeeder;
import org.openspaces.core.GigaSpace;
import org.openspaces.core.GigaSpaceConfigurer;
import org.openspaces.core.space.UrlSpaceConfigurer;
import com.j_spaces.core.IJSpace;
import com.gigaspaces.examples.tutorials.queries.feeder.AccountPreLoader;
import com.gigaspaces.examples.tutorials.queries.feeder.OrderEventFeeder;
/**
* The feeder connects to the remote space and:
* 1. Pre-loads the space with 100 accounts.
* 2. Starts feeding the space with orderEvent objects, type set
* randomly as "Normal" or "Insecure". <p>
*
* This "CodeBased" version of the feeder is configured inside the main() method.
* The Processing Unit version of the feeder uses a pu.xml configuration file and can
* run inside a stand alone container or deployed onto GigaSpaces' ServiceGrid.
*/
public class CodeBasedFeeder {
public static IJSpace space;
public static GigaSpace gigaSpace;
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
space = new UrlSpaceConfigurer("jini:).space();
gigaSpace = new GigaSpaceConfigurer(space).gigaSpace();
AccountPreLoader accountPreLoader = new AccountPreLoader();
accountPreLoader.setGigaSpace(gigaSpace);
accountPreLoader.init();
OrderEventFeeder orderEventFeeder = new OrderEventFeeder();
orderEventFeeder.setGigaSpace(gigaSpace);
orderEventFeeder.init();
}
}