Monday, December 17, 2007

Hiding and Showing table rows

Note - to show the row again, set its display to empty string, not to inline/block which doesn't work in firefox



document.getElementById('radiusRow').style.display = ''

Wednesday, December 5, 2007

RMI lookupds using 192.168.0.3 instead of localhost

When my Transporta was trying to connect to XCS for the session store bean, it was trying to connect to 192.168.0.3 (my ip address when connected to wireless at home). This was puzzling as I had set the java.naming.provider.url to localhost:1199. I event tried making it 127.0.0.1 thinking maybe there was a problem with the resolving of name localhost, or I thought maybe somewhere the lookup was being cached.

The problem was resolved by restarting XCS and is explained as follows: with RMI, the client asks uses java.naming.provider.url for a remote reference, the server responds with a server hostname and port to use to get that object. XCS was sending back its server hostname of 192.168.0.3, it hadn't updated itself since my ip changed.

From http://java.sun.com/j2se/1.4.2/docs/guide/rmi/faq.html#nethostname

For an RMI client to contact a remote RMI server, the client must first hold a reference to the server. The Naming.lookup method call is the most common mechanism by which clients initially obtain references to remote servers. Remote references may be obtained by other means, for example: all remote method calls can return remote references. This is what Naming.lookup does; it uses a well-known stub to make a remote method call to the rmiregistry, which sends back the remote reference to the object requested by the lookup method.

Every remote reference contains a server hostname and port number that allow clients to locate the VM that is serving a particular remote object. Once an RMI client has a remote reference, the client will use the hostname and port provided in the reference to open a socket connection to the remote server.

Wednesday, November 21, 2007

EJB Caching

http://wiki.jboss.org/wiki/Wiki.jsp?page=CMPCacheInvalidation

What is a container configuration?

Dependencies

Examples:
* any kind of service (eg session bean)
* config
* Transporta appconfig

Problems
* testing - dependency which requires initialization, eg. transporta appconfig
helper invokes through xcs for the appconfig
* config reads from database
* injection doesnt work for non-ejb components
* need a uniform way of handling these things
* where do you initialise things?

Solution Ideas
* dependency injection
* put all dependencies in the constructor, use interfaces
* have service locators or singletons

Dependency Injection
=====================

have an interface, and component is
injected with a working service at run time - BUT - this is troublesome if you
don't have an injection container.

alternatives to DI - new, static, Factory, JNDI

What is Spring?

Non Dependency Injection
========================

Declare dependencies in constructor, use interfaces if they need to be mocked
out. Initialization can be through JNDI container-created components, otherwise
through a setup class.

through constructors, you can make sure dependencies are met, you can easily see
what a class uses.



Links
* http://www.onjava.com/pub/a/onjava/2006/02/08/j2ee-without-application-server.html
* http://www.brandonwerner.com/category/technology/architecture/service-oriented-architecture/page/2/
* http://www.theserverside.com/tt/articles/article.tss?l=SpringFramework

Monday, October 15, 2007

EXEC sp_change_users_login 'Auto_Fix', 'vertical'

Tuesday, October 9, 2007

kml, google maps

Adding labels to markers:
http://googlemapsbook.com/2007/01/22/extending-gmarker/

kml tutorial
http://code.google.com/apis/kml/documentation/mapsSupport.html

Thursday, September 27, 2007

Composite Entity Pattern

Introduced in EJB 2.0 period to reduce the number of entity beans and use of entity beans remotely. Idea was you would have more coarse-grained entities which would have other entities as dependent objects and manage their lifecycles.

With a Composite Entity, a client can obtain all required information with just one remote method call.