Search Results

Search found 13 results on 1 pages for 'jini'.

Page 1/1 | 1 

  • Exclusive use of a Jini server during long-running call

    - by Matthew Flint
    I'm trying to use Jini, in a "Masters/Workers" arrangement, but the Worker jobs may be long running. In addition, each worker needs to have exclusive access to a singleton resource on that machine. As it stands, if a Worker receives another request while a previous request is running, then the new request is accepted and executed in a second thread. Are there any best-practices to ensure that a Worker accepts no further jobs until the current job is complete? Things I've considered: synchronize the job on the server, with a lock on the singleton resource. This would work, but is far from ideal. A call from a Master would block until the current Worker thread completes, even if other Workers become free in the meantime unregister the Worker from the registry while the job is running, then re-register when it completes. Might work OK, but something doesn't smell right with this idea... Of course, I'm quite happy to be told that there are more appropriate technologies than Jini... but I wouldn't want anything too heavyweight, like rolling out EJB containers all over the place.

    Read the article

  • Jini : single server with multiple clients

    - by user200340
    Hi all, I have a question about how to make multiple clients can access a single file located on server side and keep the file consistent. I have a simple PhoneBook server-client Jini program running at the moment, and server only provides some getter functions to clients, such as getName(String number), getNumber(String name) from a PhoneBook class(serializable), phonebook data are stored in a text file (phonebook.txt) at the moment. I have tried to implement some functions allowing to write a new records into the phonebook.txt file. If the writing record (name) is existing, an integer number will be added into the writing record. for example the existing phonebook.txt is .... John 01-01010101 .... if the writing record is "John 01-12345678",then "John_1 01-12345678" will be writen into phonebook.txt However, if i start with two clients A and B (on the same machine using localhost), and A tries to write "John 01-11111111", B tries to write "John 01-22222222". The early record will be overwritten later record. So, there must be something i did complete wrong. My client and server code are just like Jini HelloWorld example. My server side code is . 1. LookupDiscovery with parameter new String[]{""}; 2. DiscoveryListener for LookupDiscovery 3. registrations are saved into a HashTable 4. for every discovered lookup service, i use registrar to register the ServiceItem, ServiceItem contains a null attributeSets, a null serviceId, and a service. The client code has: 1. LookupDiscovery with parameter new String[]{""}; 2. DiscoveryListener for LookupDiscovery 3. a ServiceTemplate with null attributeSets, a null serviceId and a type, the type is the interface class. 4. for each found ServiceRegistrar, if it can find the looking for ServiceTemplate, the returned Object is cast into the type of the interface class. I have tried to google more details, and i found JavaSpace could be the one i missed. But i am still not sure about it (i only start Jini for a very short time). So any help would be greatly appreciated.

    Read the article

  • Drupal SQL injection attacks prevention and apostrophe handling in Forms

    - by jini
    in typical PHP applications I used to use mysql_real_escape_string before I did SQL inserts. However I am unable to do that in Drupal so would need some assistance. And without any sort of function like that, user input with apostrophes is breaking my code. Please suggest. Thank You My SQL is as follows: $sql = "INSERT INTO some_table (field1, field2) VALUES ('$field1', '$field2')"; db_query($sql);

    Read the article

  • Singleton method not getting called in Cocos2d

    - by jini
    I am calling a Singleton method that does not get called when I try doing this. I get no errors or anything, just that I am unable to see the CCLOG message. Under what reasons would a compiler not give you error and not allow you to call a method? [[GameManager sharedGameManager] openSiteWithLinkType:kLinkTypeDeveloperSite]; The method is defined as follows: -(void)openSiteWithLinkType:(LinkTypes)linkTypeToOpen { CCLOG(@"WE ARE IN openSiteWithLinkType"); //I NEVER SEE THIS MESSAGE NSURL *urlToOpen = nil; if (linkTypeToOpen == kLinkTypeDeveloperSite) { urlToOpen = [NSURL URLWithString:@"http://somesite.com"]; } if (![[UIApplication sharedApplication]openURL:urlToOpen]) { CCLOG(@"%@%@",@"Failed to open url:",[urlToOpen description]); [self runSceneWithID:kMainMenuScene]; } } HERE IS THE CODE TO MY SINGLETON: #import "GameManager.h" #import "MainMenuScene.h" @implementation GameManager static GameManager* _sharedGameManager = nil; @synthesize isMusicON; @synthesize isSoundEffectsON; @synthesize hasPlayerDied; +(GameManager*) sharedGameManager { @synchronized([GameManager class]) { if (!_sharedGameManager) { [[self alloc] init]; return _sharedGameManager; } return nil; } } +(id)alloc { @synchronized ([GameManager class]) { NSAssert(_sharedGameManager == nil,@"Attempted to allocate a second instance of the Game Manager singleton"); _sharedGameManager = [super alloc]; return _sharedGameManager; } return nil; } -(id)init { self = [super init]; if (self != nil) { //Game Manager initialized CCLOG(@"Game Manager Singleton, init"); isMusicON = YES; isSoundEffectsON = YES; hasPlayerDied = NO; currentScene = kNoSceneUninitialized; } return self; } -(void) runSceneWithID:(SceneTypes)sceneID { SceneTypes oldScene = currentScene; currentScene = sceneID; id sceneToRun = nil; switch (sceneID) { case kMainMenuScene: sceneToRun = [MainMenuScene node]; break; default: CCLOG(@"Unknown Scene ID, cannot switch scenes"); return; break; } if (sceneToRun == nil) { //Revert back, since no new scene was found currentScene = oldScene; return; } //Menu Scenes have a value of < 100 if (sceneID < 100) { if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) { CGSize screenSize = [CCDirector sharedDirector].winSizeInPixels; if (screenSize.width == 960.0f) { //iPhone 4 retina [sceneToRun setScaleX:0.9375f]; [sceneToRun setScaleY:0.8333f]; CCLOG(@"GM: Scaling for iPhone 4 (retina)"); } else { [sceneToRun setScaleX:0.4688f]; [sceneToRun setScaleY:0.4166f]; CCLOG(@"GM: Scaling for iPhone 3G or older (non-retina)"); } } } if ([[CCDirector sharedDirector] runningScene] == nil) { [[CCDirector sharedDirector] runWithScene:sceneToRun]; } else { [[CCDirector sharedDirector] replaceScene:sceneToRun]; } } -(void)openSiteWithLinkType:(LinkTypes)linkTypeToOpen { CCLOG(@"WE ARE IN openSiteWithLinkType"); NSURL *urlToOpen = nil; if (linkTypeToOpen == kLinkTypeDeveloperSite) { urlToOpen = [NSURL URLWithString:@"http://somesite.com"]; } if (![[UIApplication sharedApplication]openURL:urlToOpen]) { CCLOG(@"%@%@",@"Failed to open url:",[urlToOpen description]); [self runSceneWithID:kMainMenuScene]; } } -(void) test { CCLOG(@"this is test"); } @end

    Read the article

  • What magical thing could be killing my Drupal session and anywhere from 15-45 minutes of activity?

    - by jini
    I am using a standard Drupal install hosted on a LAMP stack. My settings.php has the following set: ini_set('session.gc_probability', 1); ini_set('session.gc_divisor', 100); ini_set('session.gc_maxlifetime', 200000); ini_set('session.cookie_lifetime', 2000000); my php.ini file has: session.gc_probability = 1 session.gc_divisor = 1000 session.gc_maxlifetime = 1440 Also I have checked that the safe mode is off so that my settings.php file is able to override main php.ini variables. Also since the person can get log out at 15 minutes, it is making me wonder whether php.ini has anything to do with it anyways. I have combed through my code and it seems to work fine on my local host however on server it is having issues. Where else can i possibly check?????

    Read the article

  • Sticky sessions not sticky on coldfusion cluster

    - by GreatSeaSpider
    we're trying to deploy a legacy coldfusion site onto a new CF8 cluster. The cluster consists of three cf instances running under JRUN4 on a single windows 2008 server. I've got the cluster set to not replicate sessions, and sticky sessions turned on. each instance is set to use J2EE session variables. The application tag for the site has: sessionmanagement="Yes" setclientcookies="Yes" setdomaincookies="Yes" when each instance starts... no errors are reported in the instance log and they join the cluster without any issues. though the intances do have: 16/10 08:31:25 info SessionReplicationService successfully joined a JINI lookup service (assigned JINI-ID .....) and 16/10 08:31:25 info Clusterable service SessionReplicationService discovered a SessionReplicationService peer on a JRun server named "xxxx" on host xxxx which is interesting since session replication is definately off, is the SessionReplicationService responsible for sticky sessions aswell? thats enough background, the problem is that the sticky sessions appear to simply not work, each request is bounced to a different instance, and it seems as if the sessions are being lost on each instance anyways? As soon as the cluster is down to a single instance, the web app works exactly as expected and the sessions seem fine. has anybody got any ideas for me? i've been trawling the web and I cant seem to find any answers.

    Read the article

  • Maven struts2 modular archetype failing to generate !

    - by Xinus
    I am trying to generate struts 2 modular archetype using maven but always getting error as archetype not present here is a full output : C:\Users\Administrator>mvn archetype:generate [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'archetype'. [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Default Project [INFO] task-segment: [archetype:generate] (aggregator-style) [INFO] ------------------------------------------------------------------------ [INFO] Preparing archetype:generate [INFO] No goals needed for project - skipping [INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus .velocity.ContextClassLoaderResourceLoader'. [INFO] Setting property: velocimacro.messages.on => 'false'. [INFO] Setting property: resource.loader => 'classpath'. [INFO] Setting property: resource.manager.logwhenfound => 'false'. [INFO] [archetype:generate {execution: default-cli}] [INFO] Generating project in Interactive mode [INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven. archetypes:maven-archetype-quickstart:1.0) Choose archetype: 1: internal -> appfuse-basic-jsf (AppFuse archetype for creating a web applicati on with Hibernate, Spring and JSF) 2: internal -> appfuse-basic-spring (AppFuse archetype for creating a web applic ation with Hibernate, Spring and Spring MVC) 3: internal -> appfuse-basic-struts (AppFuse archetype for creating a web applic ation with Hibernate, Spring and Struts 2) 4: internal -> appfuse-basic-tapestry (AppFuse archetype for creating a web appl ication with Hibernate, Spring and Tapestry 4) 5: internal -> appfuse-core (AppFuse archetype for creating a jar application wi th Hibernate and Spring and XFire) 6: internal -> appfuse-modular-jsf (AppFuse archetype for creating a modular app lication with Hibernate, Spring and JSF) 7: internal -> appfuse-modular-spring (AppFuse archetype for creating a modular application with Hibernate, Spring and Spring MVC) 8: internal -> appfuse-modular-struts (AppFuse archetype for creating a modular application with Hibernate, Spring and Struts 2) 9: internal -> appfuse-modular-tapestry (AppFuse archetype for creating a modula r application with Hibernate, Spring and Tapestry 4) 10: internal -> maven-archetype-j2ee-simple (A simple J2EE Java application) 11: internal -> maven-archetype-marmalade-mojo (A Maven plugin development proje ct using marmalade) 12: internal -> maven-archetype-mojo (A Maven Java plugin development project) 13: internal -> maven-archetype-portlet (A simple portlet application) 14: internal -> maven-archetype-profiles () 15: internal -> maven-archetype-quickstart () 16: internal -> maven-archetype-site-simple (A simple site generation project) 17: internal -> maven-archetype-site (A more complex site project) 18: internal -> maven-archetype-webapp (A simple Java web application) 19: internal -> jini-service-archetype (Archetype for Jini service project creat ion) 20: internal -> softeu-archetype-seam (JSF+Facelets+Seam Archetype) 21: internal -> softeu-archetype-seam-simple (JSF+Facelets+Seam (no persistence) Archetype) 22: internal -> softeu-archetype-jsf (JSF+Facelets Archetype) 23: internal -> jpa-maven-archetype (JPA application) 24: internal -> spring-osgi-bundle-archetype (Spring-OSGi archetype) 25: internal -> confluence-plugin-archetype (Atlassian Confluence plugin archety pe) 26: internal -> jira-plugin-archetype (Atlassian JIRA plugin archetype) 27: internal -> maven-archetype-har (Hibernate Archive) 28: internal -> maven-archetype-sar (JBoss Service Archive) 29: internal -> wicket-archetype-quickstart (A simple Apache Wicket project) 30: internal -> scala-archetype-simple (A simple scala project) 31: internal -> lift-archetype-blank (A blank/empty liftweb project) 32: internal -> lift-archetype-basic (The basic (liftweb) project) 33: internal -> cocoon-22-archetype-block-plain ([http://cocoon.apache.org/2.2/m aven-plugins/]) 34: internal -> cocoon-22-archetype-block ([http://cocoon.apache.org/2.2/maven-p lugins/]) 35: internal -> cocoon-22-archetype-webapp ([http://cocoon.apache.org/2.2/maven- plugins/]) 36: internal -> myfaces-archetype-helloworld (A simple archetype using MyFaces) 37: internal -> myfaces-archetype-helloworld-facelets (A simple archetype using MyFaces and facelets) 38: internal -> myfaces-archetype-trinidad (A simple archetype using Myfaces and Trinidad) 39: internal -> myfaces-archetype-jsfcomponents (A simple archetype for create c ustom JSF components using MyFaces) 40: internal -> gmaven-archetype-basic (Groovy basic archetype) 41: internal -> gmaven-archetype-mojo (Groovy mojo archetype) Choose a number: (1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/19/20/21/22/23/2 4/25/26/27/28/29/30/31/32/33/34/35/36/37/38/39/40/41) 15: : 8 [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] The defined artifact is not an archetype [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3 seconds [INFO] Finished at: Sat Mar 27 08:22:38 IST 2010 [INFO] Final Memory: 8M/21M [INFO] ------------------------------------------------------------------------ C:\Users\Administrator> What can be the problem ?

    Read the article

  • Space-based architecture?

    - by rcampbell
    One chapter in Pragmatic Programmer recommends looking at a blackboard/space-based architecture + a rules engine as a more flexible alternative to a traditional workflow system. The project I'm working on currently uses a workflow engine, but I'd like to evaluate alternatives. I really feel like a SBA would be a better solution to our business problems, but I'm worried about a total lack of community support/user base/venders/options. JavaSpaces is dead, and the JINI spin-off Apache River seems to be on life support. SemiSpace looks perfect, but it's a one-man show. The only viable solution seems to be GigaSpaces. I'd like to hear your thoughts on space based architecture and any experiences you've had with real world implementations.

    Read the article

  • Can you use PHP libcurl to pull files from server A to server B?

    - by Majid
    Hi, cURL and libcurl let you do things you normally do with a browser, right? Like, as if you have a jini sit inside a server and fire up a browser and do stuff. Ok then. I need a script to sit on server B, and click on download links on a server A and download files (from server A to server B). I am new to curl, and not sure if all I need is to issue a simple get or something else. I know that Content-disposition header forces the browser to save the document. Does it have the same effect on libcurl too? If it does, I'll make my serving script on server A send that header, and then serve the file. Any advice is appreciated. Thanks

    Read the article

  • At the Java DEMOgrounds - Oracle Java ME Embedded Enables the “Internet of Things”

    - by Janice J. Heiss
    I caught up with Oracle’s Robert Barnes, Senior Director, Java Product Management, who was demonstrating a new product from Oracle’s Java Platform, Micro Edition (Java ME) product portfolio, Oracle Java ME Embedded 3.2, a complete client Java runtime optimized for microcontrollers and other resource-constrained devices. Oracle’s Java ME Embedded 3.2 is a Java ME runtime based on CLDC 1.1 (JSR-139) and IMP-NG (JSR-228).“What we are showing here is the Java ME Embedded 3.2 that we announced last week,” explained Barnes. “It’s the start of the 'Internet of Things,’ in which you have very very small devices that are on the edge of the network where the sensors sit. You often have a middle area called a gateway or a concentrator which is fairly middle to higher performance. On the back end you have a very high performance server. What this is showing is Java spanning all the way from the server side right down towards the type of chip that you will get at the sensor side as the network.” Barnes explained that he had two different demos running.The first, called the Solar Panel System Demo, measures the brightness of the light.  “This,” said Barnes, “is a light source demo with a Cortex M3 controlling the motor, on the end of which is a sensor which is measuring the brightness of the lamp. This is recording the data of the brightness of the lamp and as we move the lamp out of the way, we should be able using the server to turn the sensor towards the lamp so the brightness reading will go higher. This sends the message back to the server and we can look at the web server sitting on the PC underneath the desk. We can actually see the data being passed back effectively through a back office type of function within a utility environment.” The second demo, the Smart Grid Response Demo, Barnes explained, “has the same board and processor and is still using Java ME embedded with a different app on top. This is a demand response demo. What we are seeing within the managing environment is that people want to track the pricing signals of the electricity. If it’s particularly expensive at any point in time, they may turn something off. This demo sets the price of the electricity as though this is coming from the back of the server sending pricing signals to my home.” The demo had a lamp and a fan and it was tracking the price of electricity. “If I set the price of the electricity to go over 5 cents, then the device will turn off,” explained Barnes. “I can go into my settings and, in this case, change the price to 50 cents and we can wait a minus and the lamp will go off. When I change the pricing signal so that it is lower, the lamp will come back on. The key point is that the Java software we have running is the same across all the different devices; it’s a way to build applications across multiple devices using the same software. This is important because it fixes peak loading on the network and can stops blackouts.” This demo brought me back to a prior decade when Sun Microsystems first promoted  Jini technology, a version of Java that would put everything on the network and give us the smart home. Your home would be automated to tell you when you were out of milk, when to change your light bulbs, etc. You would have access to the web and the network throughout your home.It’s interesting to see how technology moves over time – from the smart home to the Internet of Things.

    Read the article

  • How can I work around WinXP using ports 1025-5000 as ephemeral?

    - by Chris Dolan
    If you create a TCP client socket with port 0 instead of a non-zero port, then the operating system chooses any free ephemeral port for you. Most OSes choose ephemeral ports from the IANA dynamic port range of 49152-65535. However in Windows Server 2003 and earlier (including XP) Microsoft used ports 1025-5000 as the ephemeral range, according to their bind() documentation. I run multiple Java services on the same hardware. On rare occasions, this range collides with well-known ports that I use for other services (e.g. port 4160 for Jini discovery). While rare, this has caused real problems. Is there any easy way to tell Windows or Java to use a different port range for client sockets? Microsoft's docs indicate that I can change the high end of that range via the MaxUserPort TcpIP registry setting, but I see no way to change the low end. Update: I've made some progress on this. It looks like Microsoft has a concept of reserved ports that are exceptions to the ephemeral port range. There's a registry setting that lets you change this permanently and apparently there must be an API to do the same thing because there's a data structure that holds high/low values for reserved port ranges, but I can't find the actual function call anywhere... The registry solution may work, but now I'm fixated on this API.

    Read the article

1