Splunk AppDynamics

How do we cast objects in getter chain?

CommunityUser
Splunk Employee
Splunk Employee

Document [1] doesn't talk about how we can cast an object and use getter chains on that.

For example, ((MySecondClass) myFirstObject.myFirstMethod()).mySecondMethod() How do I do this in Appdynamics?

[1] https://docs.appdynamics.com/display/PRO44/Using+Getter+Chains

Labels (1)
0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi, what types of objects are you trying to cast? I see that the documentation covers examples for the following:

  • HTTP Request Objects
  • Hashmap values
  • Dictionary objects

I think it depends on the type of object -- if you can share that with me I can find an example for you, and update the docs.

Cody

0 Karma

CommunityUser
Splunk Employee
Splunk Employee

Hi Cody,

I'm using data collectors, and instrumenting on org.apache.synapse.core.axis2.Axis2Sender class' sendBack(org.apache.synapse.MessageContext smc) method.

I want to use getter chain on the method parameter (smc), but I can't use one direclty, I need to first cast org.apache.synapse.MessageContext to org.apache.synapse.core.axis2.Axis2MessageContext and then invoke getter chain on the casted object.

How do I do this?

Regards

Raj

0 Karma

Rajesh_Putta
Communicator

Hi Raj,

You need not cast object here. I understand that org.apache.synapse.core.axis2.Axis2MessageContext  implements org.apache.synapse.core.axis2.MessageContext. So when you define data collector, at run time the getter chain will be invoked on implementing object.

You can define DC on

Class :org.apache.synapse.core.axis2.Axis2MessageContext 

Method: sendBack

0th param.<getterchain>

Hope that answers your query.

Thanks

Rajesh

CommunityUser
Splunk Employee
Splunk Employee

Great question. I don't know -- let me ask the team internally and I'll get back to you.

Cody

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

Ready to make your IT operations smarter and more efficient? Discover how to automate Splunk alerts with Red ...