You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Brian Tribondeau (JIRA)" <ji...@apache.org> on 2010/04/21 16:55:49 UTC

[jira] Created: (FELIX-2296) iPojo : Unable to get a ServiceProperty change in an anonymous class

iPojo : Unable to get a ServiceProperty change in an anonymous class
--------------------------------------------------------------------

                 Key: FELIX-2296
                 URL: https://issues.apache.org/jira/browse/FELIX-2296
             Project: Felix
          Issue Type: Bug
          Components: iPOJO
    Affects Versions: iPOJO-1.4.0
            Reporter: Brian Tribondeau
            Priority: Critical


@ServiceProperty(value = "false")
private boolean                                   ready;

...

SwingUtilities.invokeLater(new Runnable() {
public void run() {
ready =  true;
}});

is not equivalent to :

SwingUtilities.invokeLater(new Runnable() {
public void run() {
connect();
}});

public void connect() {
ready = true;
}



(I use a @Require(filter = "(ready=true)) to start an another service instance)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2296) iPojo : Unable to get a ServiceProperty change in an anonymous class

Posted by "Brian Tribondeau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862253#action_12862253 ] 

Brian Tribondeau commented on FELIX-2296:
-----------------------------------------

Hello


I am currently on vacation. I will post the code in two weeks.

Fyi, I used ipojo 1.4, annotations only (@ServiceProperty & @Requires with filter) except for instance creation, and the OSGi runtime is Equinox.

The problem is using the filter property of @Requires in two separate bundles. The instance using the filter is not created.

Bundle A :

@ServiceProperty(value = "false") 
private boolean ready; 

... 

SwingUtilities.invokeLater(new Runnable() { 
public void run() { 
ready = true; 
}}); 

Bundle B :

@Require(filter = "(ready=true))

BundleConstructor() {
   sysout("You will not see me")
}

By the way, there is no Runnable variable created, the anonymous function is invoked immediately.

> iPojo : Unable to get a ServiceProperty change in an anonymous class
> --------------------------------------------------------------------
>
>                 Key: FELIX-2296
>                 URL: https://issues.apache.org/jira/browse/FELIX-2296
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0, iPOJO-1.6.0
>            Reporter: Brian Tribondeau
>            Assignee: Clement Escoffier
>            Priority: Critical
>             Fix For: iPOJO-1.8.0
>
>
> @ServiceProperty(value = "false")
> private boolean                                   ready;
> ...
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> ready =  true;
> }});
> is not equivalent to :
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> connect();
> }});
> public void connect() {
> ready = true;
> }
> (I use a @Require(filter = "(ready=true)) to start an another service instance)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2296) iPojo : Unable to get a ServiceProperty change in an anonymous class

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12862232#action_12862232 ] 

Clement Escoffier commented on FELIX-2296:
------------------------------------------

Hi,

It seems to work...
I did that:
{code:java}
       // Service properties
        private int intProp;
	private String strProp;
	private String[] strAProp;
	private int[] intAProp;
	private boolean boolProp;

	public boolean foo() {
		Runnable runnable = new Runnable() {
			public void run() {
				intProp = 3;
				boolProp = true;
				if(strProp.equals("foo")) { strProp = "bar"; }
				else { strProp = "foo"; }
				strAProp = new String[] {"foo", "bar", "baz"};
				intAProp = new int[] {3, 2, 1};
			}
		};
		new Thread(runnable).start();

		try {
			Thread.sleep(500);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}

		return true;
	}
{code}

The service properties are correctly updated inside the method. Could you give me more details ? If you have a small bundle reproducing the issue, I would be happy to check that.

> iPojo : Unable to get a ServiceProperty change in an anonymous class
> --------------------------------------------------------------------
>
>                 Key: FELIX-2296
>                 URL: https://issues.apache.org/jira/browse/FELIX-2296
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0, iPOJO-1.6.0
>            Reporter: Brian Tribondeau
>            Assignee: Clement Escoffier
>            Priority: Critical
>             Fix For: iPOJO-1.8.0
>
>
> @ServiceProperty(value = "false")
> private boolean                                   ready;
> ...
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> ready =  true;
> }});
> is not equivalent to :
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> connect();
> }});
> public void connect() {
> ready = true;
> }
> (I use a @Require(filter = "(ready=true)) to start an another service instance)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2296) iPojo : Unable to get a ServiceProperty change in an anonymous class

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12864675#action_12864675 ] 

Clement Escoffier commented on FELIX-2296:
------------------------------------------

I also tried with:
SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				intProp = 3;
				boolProp = true;
				if(strProp.equals("foo")) { strProp = "bar"; }
				else { strProp = "foo"; }
				strAProp = new String[] {"foo", "bar", "baz"};
				intAProp = new int[] {3, 2, 1};
			}
		});

		try {
			Thread.sleep(500);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}

But, it also works.


> iPojo : Unable to get a ServiceProperty change in an anonymous class
> --------------------------------------------------------------------
>
>                 Key: FELIX-2296
>                 URL: https://issues.apache.org/jira/browse/FELIX-2296
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0, iPOJO-1.6.0
>            Reporter: Brian Tribondeau
>            Assignee: Clement Escoffier
>            Priority: Critical
>             Fix For: iPOJO-1.8.0
>
>
> @ServiceProperty(value = "false")
> private boolean                                   ready;
> ...
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> ready =  true;
> }});
> is not equivalent to :
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> connect();
> }});
> public void connect() {
> ready = true;
> }
> (I use a @Require(filter = "(ready=true)) to start an another service instance)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2296) iPojo : Unable to get a ServiceProperty change in an anonymous class

Posted by "Brian Tribondeau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12869044#action_12869044 ] 

Brian Tribondeau commented on FELIX-2296:
-----------------------------------------

Hello

I have sent you a few files on your gmail adress. I hope this will help you.



> iPojo : Unable to get a ServiceProperty change in an anonymous class
> --------------------------------------------------------------------
>
>                 Key: FELIX-2296
>                 URL: https://issues.apache.org/jira/browse/FELIX-2296
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0, iPOJO-1.6.0
>            Reporter: Brian Tribondeau
>            Assignee: Clement Escoffier
>            Priority: Critical
>             Fix For: iPOJO-1.8.0
>
>
> @ServiceProperty(value = "false")
> private boolean                                   ready;
> ...
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> ready =  true;
> }});
> is not equivalent to :
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> connect();
> }});
> public void connect() {
> ready = true;
> }
> (I use a @Require(filter = "(ready=true)) to start an another service instance)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (FELIX-2296) iPojo : Unable to get a ServiceProperty change in an anonymous class

Posted by "Brian Tribondeau (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Tribondeau closed FELIX-2296.
-----------------------------------

    Fix Version/s: iPOJO-1.6.0
                       (was: iPOJO-1.8.0)
       Resolution: Cannot Reproduce

> iPojo : Unable to get a ServiceProperty change in an anonymous class
> --------------------------------------------------------------------
>
>                 Key: FELIX-2296
>                 URL: https://issues.apache.org/jira/browse/FELIX-2296
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0, iPOJO-1.6.0
>            Reporter: Brian Tribondeau
>            Assignee: Clement Escoffier
>            Priority: Critical
>             Fix For: iPOJO-1.6.0
>
>
> @ServiceProperty(value = "false")
> private boolean                                   ready;
> ...
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> ready =  true;
> }});
> is not equivalent to :
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> connect();
> }});
> public void connect() {
> ready = true;
> }
> (I use a @Require(filter = "(ready=true)) to start an another service instance)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2296) iPojo : Unable to get a ServiceProperty change in an anonymous class

Posted by "Brian Tribondeau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12860876#action_12860876 ] 

Brian Tribondeau commented on FELIX-2296:
-----------------------------------------

D'ailleurs merci pour iPojo !

 Je n'aurais probablement jamais utilisé OSGi dans mon projet pro si j'avais du vendre l'usage brut d'OSGi. Et désormais on a plus qu'une seule application capable de charger toutes les briques fonctionnelles de notre domaine. Un gain de temps et de maintenance énorme.

Bonne continuation.

> iPojo : Unable to get a ServiceProperty change in an anonymous class
> --------------------------------------------------------------------
>
>                 Key: FELIX-2296
>                 URL: https://issues.apache.org/jira/browse/FELIX-2296
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0, iPOJO-1.6.0
>            Reporter: Brian Tribondeau
>            Assignee: Clement Escoffier
>            Priority: Critical
>             Fix For: iPOJO-1.8.0
>
>
> @ServiceProperty(value = "false")
> private boolean                                   ready;
> ...
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> ready =  true;
> }});
> is not equivalent to :
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> connect();
> }});
> public void connect() {
> ready = true;
> }
> (I use a @Require(filter = "(ready=true)) to start an another service instance)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (FELIX-2296) iPojo : Unable to get a ServiceProperty change in an anonymous class

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clement Escoffier reassigned FELIX-2296:
----------------------------------------

    Assignee: Clement Escoffier

> iPojo : Unable to get a ServiceProperty change in an anonymous class
> --------------------------------------------------------------------
>
>                 Key: FELIX-2296
>                 URL: https://issues.apache.org/jira/browse/FELIX-2296
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0
>            Reporter: Brian Tribondeau
>            Assignee: Clement Escoffier
>            Priority: Critical
>
> @ServiceProperty(value = "false")
> private boolean                                   ready;
> ...
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> ready =  true;
> }});
> is not equivalent to :
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> connect();
> }});
> public void connect() {
> ready = true;
> }
> (I use a @Require(filter = "(ready=true)) to start an another service instance)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-2296) iPojo : Unable to get a ServiceProperty change in an anonymous class

Posted by "Brian Tribondeau (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12880745#action_12880745 ] 

Brian Tribondeau commented on FELIX-2296:
-----------------------------------------

The problem didn't occur with 1.6.2 release of iPojo... Solved but I am still puzzled
This ticket it is not relevant anymore so I close it.

Thanks Clement for your support !



> iPojo : Unable to get a ServiceProperty change in an anonymous class
> --------------------------------------------------------------------
>
>                 Key: FELIX-2296
>                 URL: https://issues.apache.org/jira/browse/FELIX-2296
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0, iPOJO-1.6.0
>            Reporter: Brian Tribondeau
>            Assignee: Clement Escoffier
>            Priority: Critical
>             Fix For: iPOJO-1.8.0
>
>
> @ServiceProperty(value = "false")
> private boolean                                   ready;
> ...
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> ready =  true;
> }});
> is not equivalent to :
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> connect();
> }});
> public void connect() {
> ready = true;
> }
> (I use a @Require(filter = "(ready=true)) to start an another service instance)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-2296) iPojo : Unable to get a ServiceProperty change in an anonymous class

Posted by "Brian Tribondeau (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Tribondeau updated FELIX-2296:
------------------------------------


The original code is longer, but that's the spirit ...

> iPojo : Unable to get a ServiceProperty change in an anonymous class
> --------------------------------------------------------------------
>
>                 Key: FELIX-2296
>                 URL: https://issues.apache.org/jira/browse/FELIX-2296
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0
>            Reporter: Brian Tribondeau
>            Priority: Critical
>
> @ServiceProperty(value = "false")
> private boolean                                   ready;
> ...
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> ready =  true;
> }});
> is not equivalent to :
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> connect();
> }});
> public void connect() {
> ready = true;
> }
> (I use a @Require(filter = "(ready=true)) to start an another service instance)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-2296) iPojo : Unable to get a ServiceProperty change in an anonymous class

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2296?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clement Escoffier updated FELIX-2296:
-------------------------------------

        Fix Version/s: iPOJO-1.8.0
    Affects Version/s: iPOJO-1.6.0

> iPojo : Unable to get a ServiceProperty change in an anonymous class
> --------------------------------------------------------------------
>
>                 Key: FELIX-2296
>                 URL: https://issues.apache.org/jira/browse/FELIX-2296
>             Project: Felix
>          Issue Type: Bug
>          Components: iPOJO
>    Affects Versions: iPOJO-1.4.0, iPOJO-1.6.0
>            Reporter: Brian Tribondeau
>            Assignee: Clement Escoffier
>            Priority: Critical
>             Fix For: iPOJO-1.8.0
>
>
> @ServiceProperty(value = "false")
> private boolean                                   ready;
> ...
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> ready =  true;
> }});
> is not equivalent to :
> SwingUtilities.invokeLater(new Runnable() {
> public void run() {
> connect();
> }});
> public void connect() {
> ready = true;
> }
> (I use a @Require(filter = "(ready=true)) to start an another service instance)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.