Synchronizing inner and outer classes

I have the following setup to synchronize a runnable inner class with one of the classes methods. I am still getting an Illegal moniter state exception: current thread not owner error. What am I doring wrong?
Thanks,
John
     Class OuterClass {
          public synchronized void waitForInnerClass() {
               if (mMember == null) {
                    try { wait(); } catch (InterruptedException e) { }
          class InnerClass implements Runnable {
                    public void run() {
                         synchronized (OuterClass.this) {
                              //code to set mMember
                              notifyAll();
     }

You're synchronizing on one object (OuterClass.this) but calling the notifyAll method of a different object (this). TryOuterClass.this.notifyAll();

Similar Messages

  • Hw To Make Inner Class Distinguish Func Parameter And Outer Class Var

    i fail to make an inner class distinguish among function parameter and outer class variable.
    consider the following code:
    public class a {
         int var; // i want to access this one using inner class.
         public a(int var) {
              this.var = var;
              class b {
                   public void fun() {
                        var = 100;
    i get an error a.java:9: local variable var is accessed from within inner class; needs to be declared final.
    when i change the code to this:
    public class a {
         int var; // i want to access this one using inner class.
         public a() {          
              class b {
                   public void fun() {
                        var = 100;
    it compiled no problem.it seems that inner class is accessing function parameter rather than outer class member.
    is there any syntax i can use to make me access the outer class member variable whithout renaming or removing the function parameter?
    thank you.

    a.this.var = 100; //Use this in the inner class.Amazing syntax -:)

  • Two table sources - inner and outer join

    Hi All - thanks for your help in advance!
    I have factA inner joined to dimA on pkA. However, I also want the ability to see all of dimA even if there's no fact associated. I've aliased dimA to dimB. So, factA is inner joined to dimA (on pkA) and factA is also outer joined to dimB (on pkB).
    I want just one presentable table and one logical table. In my Logical table, I have dimA and dimB as the logical table sources. Both pkA and pkB are columns and each of the other attributes are mapped to both dimA and dimB.
    In my presentation layer, I have all the columns as well as both pkA and pkB. Depending if my analysis has pkA (inner) or pkB (outer), I want to be able to pull all the other attribute columns as well. Right now, even if I have pkB (outer) in the analysis, all the other attribute columns are still null. I don't want to have to have 2 presentation tables (one for inner and another for outer). Is this possible? Or maybe there's a better way to go at it?

    Hi All - thanks for your help in advance!
    I have factA inner joined to dimA on pkA. However, I also want the ability to see all of dimA even if there's no fact associated. I've aliased dimA to dimB. So, factA is inner joined to dimA (on pkA) and factA is also outer joined to dimB (on pkB).
    I want just one presentable table and one logical table. In my Logical table, I have dimA and dimB as the logical table sources. Both pkA and pkB are columns and each of the other attributes are mapped to both dimA and dimB.
    In my presentation layer, I have all the columns as well as both pkA and pkB. Depending if my analysis has pkA (inner) or pkB (outer), I want to be able to pull all the other attribute columns as well. Right now, even if I have pkB (outer) in the analysis, all the other attribute columns are still null. I don't want to have to have 2 presentation tables (one for inner and another for outer). Is this possible? Or maybe there's a better way to go at it?

  • Create a gradient between inner and outer ellipses

    ...or any other enclosed shapes.
    Product: Adobe Photoshop Elements 3.0
    O.S.: Windows XP, SP 3
    I've searched the product Help and this forum, but am unable to find a solution to my problem.
    I'd like to use Adobe Photoshop Elements 3.0 to create an elliptically-shaped mask for use in Adobe Premiere CS3. The idea is to create two concentric ellipses of equal eccentricity. The area outside the outer ellipse is black; the area inside the inner ellipse is transparent. The area between the two elliptical boundaries is the gradient. This creates a soft-edged cameo effect in Premiere's video.
    I'm able to make a circular cameo with the Radial gradient, but have not found a way to make an arbitrarily shaped (in this case, elliptical) one.
    * Is there a way to do this at all?
    * Do I need a more recent version of Photoshop than Elements 3.0?
    Thanks for any help.
    -Larry Byler-

    If I understand correctly, you want the mask to be an ellipse that provides a vignette effect (i. e., gradually fading from the edge).
    If you have added one of the tool sets (such as Grant Dixon's Tools) that allow you to add masks, you can do this as follows:
    -- add a mask to your layer
    -- click on the mask icon to select it
    -- used the marquee tool to draw an ellipse on the mask
    -- hit CTRL-I to invert the mask
    -- fill the selection with black
    -- open the Gaussian blur filter
    -- check the Preview box
    -- select a level of blur that gives you the degree of fade-in you want.
    If you do not have mask capability you can achieve the same effect with a clipping group.
    -- create a layer below the layer you want to mask and clip it to the other (alt-G, if I remember correctly)
    -- click on the lower layer and then follow the steps above (from the 3rd one on)

  • Mixed Inner and Outer Joins in One SQL

    Oracle 11g.
    There are four tables:
    T1 (primary key: pk_t1)
    T2 (primary key: pk_t2, foreign key fk_t2_ref_t1)
    T3 (primary key: pk_t3, foreign key fk_t3_ref_t2)
    T4 (primary key: pk_t4, foreign key fk_t4_ref_t3)
    This is what I want to do:  inner join among T1, T2, and T3, then outer join with T4 (T4 may contain the null rows).  Something like:
    procedure sp_test(
    p_where_clause)
    select *
    from
         T1 inner joint T2 on pk_t1 = fk_t2_ref_t1
        inner joint T3 on pk_t2 = fk_t3_ref_t2
        left outer join T3 on pk_t3 = fk_t4_ref_t3
    where  p_where_clause;
    OR
    select *
    from
         T4 right outer join T3 on pk_t3 = fk_t4_ref_t3
        inner joint T2 on pk_t2 = fk_t3_ref_t2
        inner joint T1 on pk_t1 = fk_t2_ref_t1
    where  p_where_clause;
    Please help me to write a correct SQL to achieve this goal.
    Thanks

    Hi,
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved, so that the people who want to help you can re-create the problem and test their ideas.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    Always say which version of Oracle you're using (for example, 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002
    I'm guessing that your first attempt
    select *
    from
         T1 inner joint T2 on pk_t1 = fk_t2_ref_t1
        inner joint T3 on pk_t2 = fk_t3_ref_t2
        left outer join T3 on pk_t3 = fk_t4_ref_t3
    where  p_where_clause;
    was close; only you want to include t4 rather than a second copy of t3, and you need to spell JOIN correctly:
    SELECT  *        -- You'll probably want to specify columns
    FROM             t1
    INNER JOIN       t2     ON  pk_t1 = fk_t2_ref_t1
    INNER JOIN       t3     ON  pk_t2 = fk_t3_ref_t2
    LEFT OUTER JOIN  t4     ON  pk_t3 = fk_t4_ref_t3
    WHERE  ...

  • Part of my ipad 3 screen isnt working after changing the inner and out sreen ?

    parrt of my ipad 3 touch isnt working it worked fine till had to hange the outer screen which blew the lcd screen so replaced that as well  and since then the lcd screen hasnt worked properly ?

    This is an iPad user to user forum, so you are not addressing Apple. You probably forgot to connect something or damaged something.
    Try this - Some iPad users have been able to revive their dropped iPad. Turn the iPad over and give it a HARD SLAP on the back. May take several slaps.
    Do It Yourself iPad Repair
    http://www.ifixit.com/Device/iPad
     Cheers, Tom

  • Inner join and outer  join in infosets

    hi everyone,
    i have a doubt in infosets...
    when and why we use inner and outer joins(right outer join and left outer join) for infoset
    please give a real time scenario........
    Thanks in advance.
    Bye.

    Hello,
    Inner join:
    For example, the requirement is to show all sales documents where you have delivery exists. In this case, you join both sales ods and delivery ods in a infoset as inner join. This will match the record against the reference documents and pull only matched records.  
    Outer Join:
    Suppose you want to pull all billing/invoice details along with their FI documents related data in a report. Assume that always there might be a situation that invoice exists but not posted to FI, however, you want to have all billing documents details either it has FI document or not. In this case, you link both Billing data and FI document data in a outer join.  This will pull all invoices data either FI document exists or not.   Other words, you want to show one side of data always but adding additional details from differenent source if data exists.
    Hope, it clarifies your doubt. Let me know if any questions.
    Thanks
    Viswa

  • Question about Inner/Outer classes

    Hello!
    I'm still preparing for java cert exam and have a question. If I have Outer and Inner classes like this:
    Outer o = new Outer();
    Outer.Inner i = o.new Inner();Does this mean that 'i' has a reference to both Outer and Inner classes. Moreover, does 'i' have a reference to the 'this' of 'o'?
    Thanks,
    Victor.

    "i" doesn't have a reference. "i" is a reference. I think you are trying to express this:
    import java.lang.reflect.*;
    public class Outer {
        class Inner {
            private int foo;
        public static void main(String[] args) {
            Outer o = new Outer();
            Outer.Inner i = o.new Inner();
            for(Field field : i.getClass().getDeclaredFields()) {
                System.out.format("%s %s %s;%n", Modifier.toString(field.getModifiers()),
                    ((Class)field.getGenericType()).getName(), field.getName());
    }

  • Outer Class Accessing Inner Classes Variables

    Hi Everyone,
    Should an outer class directly access the private member variables of its inner class? Or should it get their values by calling an appropriate 'getXXX()' method?
    Just wondering.
    Thx.

    If the outer class trys to access the variable that is declared in the inner class with in a class and outside the method, then it can access in the following example
    class outer
         private int x=10;
         class inner
              int y=20;
         public void getOutput()
              inner in=new inner();
              System.out.println("The value of y is" +in.y);
         public static void main(String args[])
              outer out=new outer();
              out.getOutput();
    };

  • Inner join and outer join

    hi friends,
    how to use inner join and outer join methods in abap. pls explain

    you have to code them
    Seriously, I suggest you take an ABAP class, it's out of the scope of this forum to tech you how to program joins.
    Markus

  • Inner/Outer classes - curious matter

    Hi,
    This is from Sun Certified Programmer practice exam:
    class Outer {
       class Inner {}
    class ExtendedOuter extends Outer {
       class ExtendedInner extends Inner {}
    class Main extends Outer.Inner {
       Main( Outer ref ) {
            ref.super();
       public static void main( String[] args ) {
            new Main( new ExtendedOuter() );
    }The choices are:
    A) Compilation fails
    B) An exception is thrown at runtime
    C) The code runs with no output
    My answer was A because the line ref.super() doesn't make sense to me.
    But the correct answer is C.
    As far I as knew - super is a keyword and can be used either to access hidden members of the superclass, or to invoke specific constructor from the superclass also. What is it here???
    Could somebody explain what this line does?

    Is that because class files with no declared package
    location are automatically placed in the same
    package?Classes with no declared package are all part of an unnamed package, commonly referred to as the default package.
    In general, you should always use packages, as support for unnamed packages is implementation dependent (although all compilers and JVMs must support an unnamed package). Depending on the platform you are using, the unnamed package might include all directories and jar files on your classpath, just the current working directory, just the first directory on your classpath, or something else.
    But `ref' is not an instance of Main, but is an
    instance of ExtendedOuter (whose superclass is
    Object). Actually ExtendedOuter's superclass is Outer. However all that is important is that it is an instance of Outer, since the type checking is performed at compile time.
    So how can it be calling Main's?Because it is a superclass constructor invocation in class Main. Therefore it calls a constructor in Main's superclass. This is the syntax used to call a superclass constructor where the superclass is an inner class and the enclosing instance needs to be specified. ref is the object to be used as the enclosing instance - there is no clever trick to it - it is just a syntax.
    Also, if an instance of an innerclass exists, than an
    instance of it's outerclass must also exist. Yes, in the example the outer class instance is ref.
    Then
    won't calling the constructor of a superclass (with
    `ref.super()') be calling the constructor again after
    it (the superclass) has already existed?You can not create an object (other than instances of java.lang.Object) without calling a superclass constructor.

  • Getting the name of outer class in an inner class

    Hi,
    I have a private inner class, something like this:
    public class OuterClass extends AnotherClass {
    public OuterClass() {
    supre();
    private class innerClass1 extends SomeotherClass {
    protected void someMethod() {
    // how to get the name of outer class, that is, "OuterClass"
    Can someone please tell me how to get the name of the outer class inside the inner class method?
    Thanks in advance..
    Prasanna

    getClass().getEnclosingClass().getName()But then, you already know it, don't you?

  • Difference between inner join and outer join

    1.Difference between inner join and outer join
    2.wht is the difference in using hide and get crusor value in interactive.
    3. Using join is better or views in writting program . Which is better.

    Table 1                      Table 2
    A
    B
    C
    D
    D
    E
    F
    G
    H
    a1
    b1
    c1
    1
    1
    e1
    f1
    g1
    h1
    a2
    b2
    c2
    1
    3
    e2
    f2
    g2
    h2
    a3
    b3
    c3
    2
    4
    e3
    f3
    g3
    h3
    a4
    b4
    c4
    3
    |--|||--|
        Inner Join
        |--||||||||--|
        | A  | B  | C  | D  | D  | E  | F  | G  | H  |
        |--||||||||--|
        | a1 | b1 | c1 | 1  | 1  | e1 | f1 | g1 | h1 |
        | a2 | b2 | c2 | 1  | 1  | e1 | f1 | g1 | h1 |
        | a4 | b4 | c4 | 3  | 3  | e2 | f2 | g2 | h2 |
        |--||||||||--|
    Example
    Output a list of all flights from Frankfurt to New York between September 10th and 20th, 2001 that are not sold out:
    DATA: DATE   LIKE SFLIGHT-FLDATE,
          CARRID LIKE SFLIGHT-CARRID,
          CONNID LIKE SFLIGHT-CONNID.
    SELECT FCARRID FCONNID F~FLDATE
        INTO (CARRID, CONNID, DATE)
        FROM SFLIGHT AS F INNER JOIN SPFLI AS P
               ON FCARRID = PCARRID AND
                  FCONNID = PCONNID
        WHERE P~CITYFROM = 'FRANKFURT'
          AND P~CITYTO   = 'NEW YORK'
          AND F~FLDATE BETWEEN '20010910' AND '20010920'
          AND FSEATSOCC < FSEATSMAX.
      WRITE: / DATE, CARRID, CONNID.
    ENDSELECT.
    If there are columns with the same name in both tables, you must distinguish between them by prefixing the field descriptor with the table name or a table alias.
    Note
    In order to determine the result of a SELECT command where the FROM clause contains a join, the database system first creates a temporary table containing the lines that meet the ON condition. The WHERE condition is then applied to the temporary table. It does not matter in an inner join whether the condition is in the ON or WHEREclause. The following example returns the same solution as the previous one.
    Example
    Output of a list of all flights from Frankfurt to New York between September 10th and 20th, 2001 that are not sold out:
    DATA: DATE   LIKE SFLIGHT-FLDATE,
          CARRID LIKE SFLIGHT-CARRID,
          CONNID LIKE SFLIGHT-CONNID.
    SELECT FCARRID FCONNID F~FLDATE
        INTO (CARRID, CONNID, DATE)
        FROM SFLIGHT AS F INNER JOIN SPFLI AS P
               ON FCARRID = PCARRID
        WHERE FCONNID = PCONNID
          AND P~CITYFROM = 'FRANKFURT'
          AND P~CITYTO   = 'NEW YORK'
          AND F~FLDATE BETWEEN '20010910' AND '20010920'
          AND FSEATSOCC < FSEATSMAX.
      WRITE: / DATE, CARRID, CONNID.
    ENDSELECT.
    Note
    Since not all of the database systems supported by SAP use the standard syntax for ON conditions, the syntax has been restricted. It only allows those joins that produce the same results on all of the supported database systems:
    Only a table or view may appear to the right of the JOIN operator, not another join expression.
    Only AND is possible in the ON condition as a logical operator.
    Each comparison in the ON condition must contain a field from the right-hand table.
    If an outer join occurs in the FROM clause, all the ON conditions must contain at least one "real" JOIN condition (a condition that contains a field from tabref1 amd a field from tabref2.
    Note
    In some cases, '*' may be specified in the SELECT clause, and an internal table or work area is entered into the INTO clause (instead of a list of fields). If so, the fields are written to the target area from left to right in the order in which the tables appear in the FROM clause, according to the structure of each table work area. There can then be gaps between table work areas if you use an Alignment Request. For this reason, you should define the target work area with reference to the types of the database tables, not simply by counting the total number of fields. For an example, see below:
    Variant 3
    ... FROM tabref1 LEFT [OUTER] JOIN tabref2 ON cond
    Effect
    Selects the data from the transparent database tables and/or views specified in tabref1 and tabref2. tabref1 und tabref2 both have either the same form as in variant 1 or are themselves join expressions. The keyword OUTER can be omitted. The database tables or views specified in tabref1 and tabref2 must be recognized by the ABAP-Dictionary.
    In order to determine the result of a SELECT command where the FROM clause contains a left outer join, the database system creates a temporary table containing the lines that meet the ON condition. The remaining fields from the left-hand table (tabref1) are then added to this table, and their corresponding fields from the right-hand table are filled with ZERO values. The system then applies the WHERE condition to the table.
    Left outer join between table 1 and table 2 where column D in both tables set the join condition:
    Table 1                      Table 2
    A
    B
    C
    D
    D
    E
    F
    G
    H
    a1
    b1
    c1
    1
    1
    e1
    f1
    g1
    h1
    a2
    b2
    c2
    1
    3
    e2
    f2
    g2
    h2
    a3
    b3
    c3
    2
    4
    e3
    f3
    g3
    h3
    a4
    b4
    c4
    3
    |--|||--|
        Left Outer Join
        |--||||||||--|
        | A  | B  | C  | D  | D  | E  | F  | G  | H  |
        |--||||||||--|
        | a1 | b1 | c1 | 1  | 1  | e1 | f1 | g1 | h1 |
        | a2 | b2 | c2 | 1  | 1  | e1 | f1 | g1 | h1 |
        | a3 | b3 | c3 | 2  |NULL|NULL|NULL|NULL|NULL|
        | a4 | b4 | c4 | 3  | 3  | e2 | f2 | g2 | h2 |
        |--||||||||--|
    Regards
    Prabhu

  • Inner class access to outer class variables

    class X extends JTextField {
    int variable_a;
    public X() {
    setDocument(
    new PlainDocument() {
    //here i need access to variable_a
    i don't want to make variable_a a static member though, so does anyone know how to do it?

    Generally, you can reference your variable_a just as you would any other variable except if your inner class also defines a variable_a. However, to produce a reference to the enclosing outer class object you write "OuterClassName.this". So, to get to your variable I think you would write "X.this.variable_a". I hope this helps.

  • SYNTAX "INNER JOIN and OUTER JOIN"

    Hi Experts,
    I think LEFT JOIN,INNER JOIN syntax is in ANSI.
    I know that Oracle has got its own alternate(+) operator to serve the purpose.
    Please tell me whether INNER JOIN,OUTER JOIN,LEFT JOIN,LEFT OUTER JOIN,RIGHT OUTER JOIN these syntaxes present in ORACLE 8I.
    If not in 9i Or highr versions are they existing?
    Thanks in advance,
    Ananth
    null

    Hi,
    8i has inner join. (+) syntax supports LEFT or RIGHT OUTER JOIN.
    FULL OUTER JOIN is supported in 9i, which introduces the JOIN keyword.
    Herman

Maybe you are looking for

  • Calendar Parameter displays an error when scheduling a report.

    Hello, We have Business Objects XI R1 (11.0.0.1282) and Crystal Reports XI (11.0.0.1282) on our Business Objects Server. When we run a report with a date parameter in it, in either Crystal Reports Designer on the server or via Business Objects Info V

  • Viewing photos on TV

    I've purchased the Universal Dock and the component video cable to hook my iPhone up to my home entertainment system. I can watch video podcasts and TV shows from my iPhone, but I cannot view photo slide shows. What am I doing wrong? All the literatu

  • BADI - CRM_CUSTOMER_I_BADI - IN SOLUTION MANAGER OF SAP.

    Hi Friends,   I am facing some problems in creating a custom tabs in CRMD_ORDER Transaction code in Solution Manager of SAP. Actually my requirement is adding of two tabs(one is header & another is item tab) in the above Transaction, i was able to pu

  • Location of mailbox

    I am still using G3 Power MAc running Mac OS 10.4.9. Because of the limitation on the size of the disc for installing Mac OS 10.4, it can only have the first 8 GB. In the meantime, I need to save some of e-mail in the Mailboxes. which have taken more

  • Java Icon in JDialog

    Hi all, Can some one tell me, how to remove the Java Icon from the left upper corner in the instance class of JDialog? Thanks, Genrry.