-
1. Re: Remote CMR with certain QWAN?
sanne Mar 24, 2003 9:24 AM (in response to sanne)O.k. FYI.
I think I'll revert to the session facades and make it work that way, now I've got:
public Address getRemoteAddress() {return localToRemote(getAddressLocal());}
/**
* @ejb.interface-method view-type="remote"
*/
public void setRemoteAddress(Address address) {setAddressLocal(remoteToLocal(address));}
public AddressLocal remoteToLocal(Address remoteAddress){
if(remoteAddress == null) {return null;}
try
{
AddressLocalHome addressLocalHome = AddressUtil.getLocalHome();
return addressLocalHome.findByPrimaryKey((String)remoteAddress.getPrimaryKey());
} catch (NamingException e)
{
throw new EJBException("Error converting remote into local Unit", e);
}
catch (RemoteException e)
{
throw new EJBException("Error converting remote into local Unit", e);
} catch (FinderException e)
{
throw new EJBException("Error converting remote into local Unit", e);
}
}
public Address localToRemote(AddressLocal localAddress){
if(localAddress == null) {return null;}
try
{
AddressHome addressHome = AddressUtil.getHome();
return addressHome.findByPrimaryKey((String)localAddress.getPrimaryKey());
} catch (NamingException e)
{
throw new EJBException("Error converting remote into local Unit", e);
} catch (FinderException e)
{
throw new EJBException("Error converting remote into local Unit", e);
} catch (RemoteException e)
{
throw new EJBException("Error converting remote into local Unit", e);
}
}