You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Jordan Zimmerman <jo...@shop.com> on 2009/02/24 02:43:32 UTC

Please make PipelinedDataPreloader.getSocialUri() protected

https://issues.apache.org/jira/browse/SHINDIG-936

Jordan Zimmerman
Principal Software Architect
831.647.4712
831.214.2990 (cell)
jordanz@shop.com 

SHOP*COMTM
Shop Smart, Save Big(tm)
www.shop.com

This message (including any attachments) is intended only for
the use of the individual or entity to which it is addressed and
may contain information that is non-public, proprietary,
privileged, confidential, and exempt from disclosure under
applicable law or may constitute as attorney work product.
If you are not the intended recipient, you are hereby notified
that any use, dissemination, distribution, or copying of this
communication is strictly prohibited. If you have received this
communication in error, notify us immediately by telephone and
(i) destroy this message if a facsimile or (ii) delete this 
message
immediately if this is an electronic communication.

Thank you.

RE: Please make PipelinedDataPreloader.getSocialUri() protected

Posted by Jordan Zimmerman <jo...@shop.com>.
>Sounds right.  Clearly, something isn't, and I'm 99.9% positive it's
>not a problem with Guice.

After HOURS of debugging I found the problem. Farging MAVEN was holding
on to an old version of JAR. I ran a "clear" and it fixed the problem. 

Debugging Guice modules, maven scripts et al is a real pleasure >(

Jordan Zimmerman
Principal Software Architect
831.647.4712
831.214.2990 (cell)
jordanz@shop.com 

SHOP*COMTM
Shop Smart, Save Big(tm)
www.shop.com


This message (including any attachments) is intended only for
the use of the individual or entity to which it is addressed and
may contain information that is non-public, proprietary,
privileged, confidential, and exempt from disclosure under
applicable law or may constitute as attorney work product.
If you are not the intended recipient, you are hereby notified
that any use, dissemination, distribution, or copying of this
communication is strictly prohibited. If you have received this
communication in error, notify us immediately by telephone and
(i) destroy this message if a facsimile or (ii) delete this 
message
immediately if this is an electronic communication.

Thank you.

Re: Please make PipelinedDataPreloader.getSocialUri() protected

Posted by Adam Winer <aw...@google.com>.
Sounds right.  Clearly, something isn't, and I'm 99.9% positive it's
not a problem with Guice.

On Thu, Mar 5, 2009 at 3:25 PM, Jordan Zimmerman <jo...@shop.com> wrote:
> So, here's how I'm binding:
>
> bind(PipelinedDataPreloader.class).to(MediatedPipelinedDataPreloader.cla
> ss);
>
> Then, my web.xml has my Guice module listed first.
>
> I recompiled, etc.
>
> Jordan Zimmerman
> Principal Software Architect
> 831.647.4712
> 831.214.2990 (cell)
> jordanz@shop.com
>
> SHOP*COMTM
> Shop Smart, Save Big(tm)
> www.shop.com
>
>
> -----Original Message-----
> From: Jordan Zimmerman [mailto:jordanz@shop.com]
> Sent: Thursday, March 05, 2009 3:23 PM
> To: shindig-dev@incubator.apache.org
> Subject: RE: Please make PipelinedDataPreloader.getSocialUri() protected
>
>
> Adam - you wrote:
>
> "executeSocialRequest() is in the latest code on trunk:
> Recommend overriding that instead of binding a custom pipeline."
>
> I have not found a way to do this with the current trunk as the
> PreloadModule is hard-coded to PipelinedDataPreloader.
>
> You also wrote:
>
> " (1) bind(PipelinedDataPreloader.class).to(YourSubclass.class) in your
> own module. Yes, you can bind concrete classes to subclasses."
>
> I tried this and it didn't work. The constructor to PreloaderProvider()
> still got PipelinedDataPreloader not my version. Are you certain this
> works? Have you tried it yourself?
>
> " (2) Take advantage of the factored-apart DefaultGuiceModule, which is
> now just:"
>
> It seems like really bad form to have to alter the Shindig source
> directly. Isn't that the point of using DI?
>
>
> Jordan Zimmerman
> Principal Software Architect
> 831.647.4712
> 831.214.2990 (cell)
> jordanz@shop.com
>
> SHOP*COMTM
> Shop Smart, Save Big(tm)
> www.shop.com
>
> This message (including any attachments) is intended only for
> the use of the individual or entity to which it is addressed and
> may contain information that is non-public, proprietary,
> privileged, confidential, and exempt from disclosure under
> applicable law or may constitute as attorney work product.
> If you are not the intended recipient, you are hereby notified
> that any use, dissemination, distribution, or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, notify us immediately by telephone and
> (i) destroy this message if a facsimile or (ii) delete this
> message
> immediately if this is an electronic communication.
>
> Thank you.
>

RE: Please make PipelinedDataPreloader.getSocialUri() protected

Posted by Jordan Zimmerman <jo...@shop.com>.
So, here's how I'm binding:

bind(PipelinedDataPreloader.class).to(MediatedPipelinedDataPreloader.cla
ss);

Then, my web.xml has my Guice module listed first.

I recompiled, etc.

Jordan Zimmerman
Principal Software Architect
831.647.4712
831.214.2990 (cell)
jordanz@shop.com 

SHOP*COMTM
Shop Smart, Save Big(tm)
www.shop.com


-----Original Message-----
From: Jordan Zimmerman [mailto:jordanz@shop.com] 
Sent: Thursday, March 05, 2009 3:23 PM
To: shindig-dev@incubator.apache.org
Subject: RE: Please make PipelinedDataPreloader.getSocialUri() protected


Adam - you wrote:

"executeSocialRequest() is in the latest code on trunk:
Recommend overriding that instead of binding a custom pipeline."

I have not found a way to do this with the current trunk as the
PreloadModule is hard-coded to PipelinedDataPreloader. 

You also wrote:

" (1) bind(PipelinedDataPreloader.class).to(YourSubclass.class) in your
own module. Yes, you can bind concrete classes to subclasses."

I tried this and it didn't work. The constructor to PreloaderProvider()
still got PipelinedDataPreloader not my version. Are you certain this
works? Have you tried it yourself?

" (2) Take advantage of the factored-apart DefaultGuiceModule, which is
now just:"

It seems like really bad form to have to alter the Shindig source
directly. Isn't that the point of using DI?


Jordan Zimmerman
Principal Software Architect
831.647.4712
831.214.2990 (cell)
jordanz@shop.com 

SHOP*COMTM
Shop Smart, Save Big(tm)
www.shop.com

This message (including any attachments) is intended only for
the use of the individual or entity to which it is addressed and
may contain information that is non-public, proprietary,
privileged, confidential, and exempt from disclosure under
applicable law or may constitute as attorney work product.
If you are not the intended recipient, you are hereby notified
that any use, dissemination, distribution, or copying of this
communication is strictly prohibited. If you have received this
communication in error, notify us immediately by telephone and
(i) destroy this message if a facsimile or (ii) delete this 
message
immediately if this is an electronic communication.

Thank you.

Re: Please make PipelinedDataPreloader.getSocialUri() protected

Posted by Adam Winer <aw...@google.com>.
On Thu, Mar 5, 2009 at 3:28 PM, Adam Winer <aw...@google.com> wrote:
> On Thu, Mar 5, 2009 at 3:23 PM, Jordan Zimmerman <jo...@shop.com> wrote:
>> Adam - you wrote:
>>
>> "executeSocialRequest() is in the latest code on trunk:
>> Recommend overriding that instead of binding a custom pipeline."
>>
>> I have not found a way to do this with the current trunk as the
>> PreloadModule is hard-coded to PipelinedDataPreloader.
>> You also wrote:
>>
>> " (1) bind(PipelinedDataPreloader.class).to(YourSubclass.class) in your
>> own module. Yes, you can bind concrete classes to subclasses."
>>
>> I tried this and it didn't work. The constructor to PreloaderProvider()
>> still got PipelinedDataPreloader not my version. Are you certain this
>> works? Have you tried it yourself?
>
> Yes, many many times.  This really does work, and has to.  Try this:
>
> package org.apache.shindig.common;
>
> import com.google.inject.AbstractModule;
> import com.google.inject.Guice;
> import com.google.inject.Inject;
> import com.google.inject.Injector;
>
> public class QuickGuiceExample {
>  static public void main(String[] args) {
>    Injector injector = Guice.createInjector(new MyModule());
>    injector.getInstance(Target.class);
>  }
>
>  static class MyModule extends AbstractModule {
>    protected void configure() {
>      bind(Some.class).to(SomeOther.class);
>    }
>  }
>
>  static class Target {
>    @Inject Target(Some some) {
>      System.out.println(some.getClass());
>    }
>  }
>  static class Some {}
>  static class SomeOther extends Some {}
> }
>
> It prints SomeOther.class.
>
>
>> " (2) Take advantage of the factored-apart DefaultGuiceModule, which is
>> now just:"
>>
>> It seems like really bad form to have to alter the Shindig source
>> directly. Isn't that the point of using DI?
>
> My point is that I've already altered the Shindig source.

... that is, by breaking apart DefaultGuiceModule, so you can largely
reuse all the pieces, just swapping out the modules that you don't
want.  That's the best that can be done with Guice 1.0.

>>
>>
>> Jordan Zimmerman
>> Principal Software Architect
>> 831.647.4712
>> 831.214.2990 (cell)
>> jordanz@shop.com
>>
>> SHOP*COMTM
>> Shop Smart, Save Big(tm)
>> www.shop.com
>>
>> This message (including any attachments) is intended only for
>> the use of the individual or entity to which it is addressed and
>> may contain information that is non-public, proprietary,
>> privileged, confidential, and exempt from disclosure under
>> applicable law or may constitute as attorney work product.
>> If you are not the intended recipient, you are hereby notified
>> that any use, dissemination, distribution, or copying of this
>> communication is strictly prohibited. If you have received this
>> communication in error, notify us immediately by telephone and
>> (i) destroy this message if a facsimile or (ii) delete this
>> message
>> immediately if this is an electronic communication.
>>
>> Thank you.
>>
>

Re: Please make PipelinedDataPreloader.getSocialUri() protected

Posted by Adam Winer <aw...@google.com>.
On Thu, Mar 5, 2009 at 3:23 PM, Jordan Zimmerman <jo...@shop.com> wrote:
> Adam - you wrote:
>
> "executeSocialRequest() is in the latest code on trunk:
> Recommend overriding that instead of binding a custom pipeline."
>
> I have not found a way to do this with the current trunk as the
> PreloadModule is hard-coded to PipelinedDataPreloader.
> You also wrote:
>
> " (1) bind(PipelinedDataPreloader.class).to(YourSubclass.class) in your
> own module. Yes, you can bind concrete classes to subclasses."
>
> I tried this and it didn't work. The constructor to PreloaderProvider()
> still got PipelinedDataPreloader not my version. Are you certain this
> works? Have you tried it yourself?

Yes, many many times.  This really does work, and has to.  Try this:

package org.apache.shindig.common;

import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Inject;
import com.google.inject.Injector;

public class QuickGuiceExample {
  static public void main(String[] args) {
    Injector injector = Guice.createInjector(new MyModule());
    injector.getInstance(Target.class);
  }

  static class MyModule extends AbstractModule {
    protected void configure() {
      bind(Some.class).to(SomeOther.class);
    }
  }

  static class Target {
    @Inject Target(Some some) {
      System.out.println(some.getClass());
    }
  }
  static class Some {}
  static class SomeOther extends Some {}
}

It prints SomeOther.class.


> " (2) Take advantage of the factored-apart DefaultGuiceModule, which is
> now just:"
>
> It seems like really bad form to have to alter the Shindig source
> directly. Isn't that the point of using DI?

My point is that I've already altered the Shindig source.
>
>
> Jordan Zimmerman
> Principal Software Architect
> 831.647.4712
> 831.214.2990 (cell)
> jordanz@shop.com
>
> SHOP*COMTM
> Shop Smart, Save Big(tm)
> www.shop.com
>
> This message (including any attachments) is intended only for
> the use of the individual or entity to which it is addressed and
> may contain information that is non-public, proprietary,
> privileged, confidential, and exempt from disclosure under
> applicable law or may constitute as attorney work product.
> If you are not the intended recipient, you are hereby notified
> that any use, dissemination, distribution, or copying of this
> communication is strictly prohibited. If you have received this
> communication in error, notify us immediately by telephone and
> (i) destroy this message if a facsimile or (ii) delete this
> message
> immediately if this is an electronic communication.
>
> Thank you.
>

RE: Please make PipelinedDataPreloader.getSocialUri() protected

Posted by Jordan Zimmerman <jo...@shop.com>.
Adam - you wrote:

"executeSocialRequest() is in the latest code on trunk:
Recommend overriding that instead of binding a custom pipeline."

I have not found a way to do this with the current trunk as the
PreloadModule is hard-coded to PipelinedDataPreloader. 

You also wrote:

" (1) bind(PipelinedDataPreloader.class).to(YourSubclass.class) in your
own module. Yes, you can bind concrete classes to subclasses."

I tried this and it didn't work. The constructor to PreloaderProvider()
still got PipelinedDataPreloader not my version. Are you certain this
works? Have you tried it yourself?

" (2) Take advantage of the factored-apart DefaultGuiceModule, which is
now just:"

It seems like really bad form to have to alter the Shindig source
directly. Isn't that the point of using DI?


Jordan Zimmerman
Principal Software Architect
831.647.4712
831.214.2990 (cell)
jordanz@shop.com 

SHOP*COMTM
Shop Smart, Save Big(tm)
www.shop.com

This message (including any attachments) is intended only for
the use of the individual or entity to which it is addressed and
may contain information that is non-public, proprietary,
privileged, confidential, and exempt from disclosure under
applicable law or may constitute as attorney work product.
If you are not the intended recipient, you are hereby notified
that any use, dissemination, distribution, or copying of this
communication is strictly prohibited. If you have received this
communication in error, notify us immediately by telephone and
(i) destroy this message if a facsimile or (ii) delete this 
message
immediately if this is an electronic communication.

Thank you.