[jboss-jira] [JBoss JIRA] (WFLY-1424) Remote lookup for Referenceable returns Reference and not the real object
jaikiran pai (JIRA)
jira-events at lists.jboss.org
Fri May 31 03:02:54 EDT 2013
[ https://issues.jboss.org/browse/WFLY-1424?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
jaikiran pai updated WFLY-1424:
-------------------------------
Issue Type: Bug (was: Feature Request)
Component/s: Naming
Classifying this as a bug (instead of feature request) since apparently this was working in AS 7.1.1 and EAP 6.1, but no longer works.
P.S: This appears to be a remote-naming related issue.
> Remote lookup for Referenceable returns Reference and not the real object
> -------------------------------------------------------------------------
>
> Key: WFLY-1424
> URL: https://issues.jboss.org/browse/WFLY-1424
> Project: WildFly
> Issue Type: Bug
> Components: Naming
> Affects Versions: 8.0.0.Alpha1
> Reporter: Natasha Biryukov
>
> In JBoss EAP6.1 Alfa and Beta during remote lookup for obejct that implements Referenceable the coresponding ObjectFactory is not called, as a result the Reference object is returned and not the real one.
> Code example:
> public class Fruit implements Referenceable {
> String fruit;
> public Fruit(String f) {
> fruit = f;
> }
> public Reference getReference() throws NamingException {
> return new Reference(
> Fruit.class.getName(),
> new StringRefAddr("fruit", fruit),
> FruitFactory.class.getName(),
> null);
> }
> public String toString() {
> return fruit;
> }
> }
> public class FruitFactory implements ObjectFactory {
> @Override
> public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment) throws Exception {
> Reference localObject1;
> if (obj instanceof Reference) {
> localObject1 = (Reference) obj;
> Object fruit = localObject1.get("fruit").getContent();
> return new Fruit((String)fruit);
> } else {
> return obj;
> }
> }
> }
> Fruit f = new Fruit("apple");
> context.bind("apple", f);
> Fruit f1 = (Fruit)context.lookup("apple");
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list