Search:

Type: Posts; User: astalla; Keyword(s):

Page 1 of 2 1 2

Search: Search took 0.02 seconds.

  1. Replies
    3
    Views
    709

    There is a way, but you need to write code for it...

    There is a way, but you need to write code for it yourself. If you define a bean which is a BeanFactoryPostProcessor...
  2. Replies
    1
    Views
    642

    Try simply with:

    Try simply with:


    <property name="objHand" value="a.b.c.IamAClass"/>

    Spring should automatically convert the string "a.b.c.IamAClass" to a Class instance, using the appropriate classloader....
  3. Replies
    2
    Views
    3,058

    In a functional language like Clojure, dependency...

    In a functional language like Clojure, dependency injection essentially amounts to passing parameters to functions. A framework like Spring is basically not needed, since of course calling functions...
  4. This is something that should really be...

    This is something that should really be implemented in the container itself. Perhaps with a parallel-init attribute to <bean>. You should file a jira request for it; until the Spring people implement...
  5. Replies
    0
    Views
    557

    Advising bean instantiation

    I have a rather complex requirement. I need to ensure that for certain beans a dynamic context is established during their instantiation. I.e. something like:


    Context.push(...)
    Foo foo = new...
  6. ClassPathXmlApplicationContext is a...

    ClassPathXmlApplicationContext is a RefreshableApplicationContext implementation: it'll create a new BeanFactory each time you call refresh(). In order to register your InstantiationStrategy on the...
  7. Replies
    5
    Views
    1,188

    I don't know EJB at all, but to me that's a...

    I don't know EJB at all, but to me that's a strange definition of "stateless".



    Of course it's not, because there's mutable state involved (that's why "stateless" doesn't sound right to me).
    ...
  8. Replies
    5
    Views
    1,188

    Well, let's put it this way: in Spring is as...

    Well, let's put it this way: in Spring is as trivial as it can be in Java.



    I don't follow you. If an object is stateless, then it's thread-safe by definition, so why would you need pooling?...
  9. Replies
    5
    Views
    1,188

    It's trivial to implement this kind of "thread...

    It's trivial to implement this kind of "thread safety" in Spring with a method interceptor that synchronizes all the calls on the receiver object. However, I wouldn't want to do that in general....
  10. Replies
    4
    Views
    801

    You can give prototype scope to your bean and ask...

    You can give prototype scope to your bean and ask the context to create a new one each time you need to "reload" it. Of course, any other bean that is a property of your refreshable bean and that you...
  11. You're not getting the concept right....

    You're not getting the concept right. Lookup-method injection is a way to use Spring as a factory, while keeping your code independent from Spring. This is a non-Spring example:



    public class...
  12. Use the collection merging feature...

    Use the collection merging feature (http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/beans.html#beans-collection-elements):



    <bean id="listPrinter"...
  13. Actually the problem has nothing to do with...

    Actually the problem has nothing to do with proxies. The OP seems to be a little confused about the lookup method feature. The CommandManager class is redundant and the createCommand lookup-method...
  14. Best place to announce Spring-centered open source projects?

    Greetings,

    I'm the author of an open source library heavily based on Spring, and I'd like to promote it a bit (i.e. announce releases when I do them). Is there a specific forum for that? Can I...
  15. You can't easily extract that information from...

    You can't easily extract that information from source code; however, you can inspect the ApplicationContext at runtime, e.g. with the aid of a debugger or with custom code to extract the information...
  16. Hi. The pseudo-code I posted is precisely...

    Hi.



    The pseudo-code I posted is precisely intended to avoid the refresh on the context that defines the service beans. If you look closely, you'll see that such context (which I called...
  17. You can't "DI existing service beans with those...

    You can't "DI existing service beans with those objects" with Spring (not out of the box, that is). If you refresh the context, you will create new instances of all the beans. You may be able to...
  18. Replies
    11
    Views
    1,259

    Schema validation and typing are not related. XML...

    Schema validation and typing are not related. XML is not typed, or better, its only types are nodes, elements, attributes, text strings, and possibly a few others I don't know about, and they're not...
  19. Technically you can configure it using...

    Technically you can configure it using factory-methods and factory-beans, but it'll be really cumbersome. You could use the builder pattern in Java and hook that to Spring using annotation-driven...
  20. The DSL is based on Lisp. It is basically an API...

    The DSL is based on Lisp. It is basically an API for Spring plus a few macros to give it a declarative feel. (if you don't know Lisp, think of a language framework with a built-in configurable...
  21. I realized I haven't really answered to your "how...

    I realized I haven't really answered to your "how did you do it?" question. What I do is, using my custom BeanDefinitionReader which understands my DSL, set an attribute on the BeanDefinition that...
  22. I implemented a whole custom language which is...

    I implemented a whole custom language which is not based on XML. Of course it does other things besides allowing to inject listeners, or it would have been extremely overkill.
  23. Replies
    2
    Views
    529

    Technically you can't, given an arbitrary...

    Technically you can't, given an arbitrary ApplicationContext. However, if you have a ConfigurableApplicationContext (AFAIK all the types of application contexts shipped by Spring are implementations...
  24. No, you can't. The easiest option is probably to...

    No, you can't. The easiest option is probably to use a custom factory bean, something in the vein of:

    <bean name="anotherExampleBean" class="com.xxx.MethodInjectionFactoryBean">
    <property...
  25. Replies
    1
    Views
    638

    What have you tried, and why didn't it work? ...

    What have you tried, and why didn't it work?

    You can have a look at this blog post to see if it helps you: http://robertmaldon.blogspot.com/2007/04/conditionally-defining-spring-beans.html

    Or -...
Results 1 to 25 of 35
Page 1 of 2 1 2