Local/Remote Transparency


EJB design: Local/Remote Transparency

  1. Local/Remote Transparency (1 messages)

    One of the basic design goals of EJB is to achive location transparency as EJB spec says. This is not to depend on mashine names and ... ! but when a simple Java Application Client considers to connect to our EJB system, it should
    use server(s) mashine names and ports. ( JNDI url ) i mean this is core of JNDI and RMI. so is inherited by EJB on top of them! anit ?
    Would u plz clarify me then what that location transparency means?
    if u have 2 remote session beans each on a specif server ( phisically mashine ) then u should use to JNDI urls to access them! am i right ?
  2. Local/Remote Transparency[ Go to top ]

    Remote transparency is not magic. You have to give the EJB environment some indication of where your objects are actually located.

    Having said that, the only place where you specify the location of your object is the initial JNDI lookup. This puts the "machine location" code in exactly one place: the creation of your InitialContext. It is a simple matter to isolate this code, and you make things even more flexible by putting the JNDI machine address in a configuration file.

    Finally, most EJB servers allow you to look up your EJBs through a single "cluster controller", which routes the actual request to a different EJB server using a variety of load-balancing mechanisms.