0

I have an issue in a new devkit Project where the following @ValidateConnection method is failing to be called (but my @processor methods are called fine when requested in the flows)

 @ValidateConnection
    public boolean isConnected() {
        return isConnected;
    }

I thought that the above should be called to check whether to call the @Connect method.

I think it is because I am using a non default category (Components) for the connector

@Category(name = "org.mule.tooling.category.core", description = "Components")

And the resulting Behavoir is different to what I am used to with DevKit in Cloud connector mode.

I guess I will need to do checks in each @processor for now to see if the initialization logic is done, as there doesn't seem to be an easy way to run a one time config.

EDIT_________________ I actually tried porting it back to a cloud connector @cat and the same behaviour, maybe its an issue with devkit -DarchetypeVersion=3.4.0, I used 3.2.x somthing before and things worked a bit better

Nikos
  • 7,295
  • 7
  • 52
  • 88

1 Answers1

1

The @ValidateConnection annotated method in the @Connector is called at the end of the makeObject() method of the generated *ConnectionFactory class. If you look for references of who is calling your isConnected() you should be able to confirm this.

So no, you should not need to perform the checks, it should be done automatically for you.

There must be something else missing... do you have a @ConnectionIdentifier annotated method?

PS. @Category annotation is purely for cosmetic purposes in Studio.

David Dossot
  • 33,403
  • 4
  • 38
  • 72
  • will check tomorrow, I do know that adding @ConnectionIdentifier didn't make a difference.. – Nikos Jul 11 '13 at 20:29
  • interestingly doing a text search for isConnected didn't result in any matches in the generated sources. – Nikos Jul 11 '13 at 20:53
  • That's bad IMO, there's an issue somewhere. Also doesn't your IDE have reference search? :) – David Dossot Jul 11 '13 at 20:54
  • eclipse ctrl+shift +G is unfruitful in this case, text search just finds matches in the apiDOcs – Nikos Jul 11 '13 at 21:08
  • We will just have a workaround for now, doing init checks in each @proc method. Maybe next devKit project it will work, for now DevKit seems a bit hap hazord. But it beats doing connectors the old way – Nikos Jul 11 '13 at 21:10
  • That sucks: **do not do that**. DevKit works, we need to find out why it doesn't in your particular case, which is hard with the partial information you're providing. Can you share your Maven project somewhere? – David Dossot Jul 11 '13 at 21:12
  • Hmm for some reason time there is no FooConnectionManager class generated like my last successful devKit project – Nikos Jul 12 '13 at 15:05
  • in the gen'ed **adaptor** package I only have the classes **[HttpCallbackAdapter.java, PoolManager.java]** wheras in the other successful project: **[FooCapabilitiesAdapter.java,FooConnectionManager.java,FooInjectionAdapter.java,FooLifecycleAdapter.java]** – Nikos Jul 12 '13 at 15:23
  • there are all these other packages created also like **[oauth,config,connection,devkit..etc]** created, its like nothing specific to my project is generated. – Nikos Jul 12 '13 at 15:26
  • Indeed, there is a problem. Can you show the relevant parts of your POM? Maybe it's just a config issue? – David Dossot Jul 12 '13 at 16:03