> **Experimental**
>
> `@aws-cdk/aws-applicationsignals-alpha` is an [**experimental**](https://docs.aws.amazon.com/cdk/api/stability.html) (alpha) package: its API may change in any release, without a major version bump.
# JavaInjector

Java-specific implementation of the SDK injector.

Handles Java agent configuration and environment setup.

Extends: [Injector](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-applicationsignals-alpha.Injector.html) › JavaInjector

- Stability: [Experimental](https://docs.aws.amazon.com/cdk/api/stability.html)
- Source: [`lib/enablement/ecs-sdk-instrumentation.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-applicationsignals-alpha/lib/enablement/ecs-sdk-instrumentation.ts#L168)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as applicationsignals_alpha from '@aws-cdk/aws-applicationsignals-alpha';

declare const instrumentationVersion: applicationsignals_alpha.InstrumentationVersion;
const javaInjector = new applicationsignals_alpha.JavaInjector('sharedVolumeName', instrumentationVersion, /* all optional props */ [{
  name: 'name',
  value: 'value',
}]);
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_applicationsignals_alpha as applicationsignals_alpha

# instrumentation_version: applicationsignals_alpha.InstrumentationVersion

java_injector = applicationsignals_alpha.JavaInjector("sharedVolumeName", instrumentation_version, [applicationsignals_alpha.EnvironmentExtension(
    name="name",
    value="value"
)])
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.applicationsignals.alpha.*;

InstrumentationVersion instrumentationVersion;

JavaInjector javaInjector = new JavaInjector("sharedVolumeName", instrumentationVersion, List.of(EnvironmentExtension.builder()
        .name("name")
        .value("value")
        .build()));
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.ApplicationSignals.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ApplicationSignals.Alpha;

InstrumentationVersion instrumentationVersion;

var javaInjector = new JavaInjector("sharedVolumeName", instrumentationVersion, new [] { new EnvironmentExtension {
    Name = "name",
    Value = "value"
} });
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdkapplicationsignalsalpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import applicationsignals_alpha "github.com/aws/aws-cdk-go/awscdkapplicationsignalsalpha"

var instrumentationVersion InstrumentationVersion

javaInjector := applicationsignals_alpha.NewJavaInjector(jsii.String("sharedVolumeName"), instrumentationVersion, []EnvironmentExtension{
	&EnvironmentExtension{
		Name: jsii.String("name"),
		Value: jsii.String("value"),
	},
})
```

## Initializer

TypeScript:

```ts
new JavaInjector(sharedVolumeName: string, instrumentationVersion: InstrumentationVersion, overrideEnvironments?: EnvironmentExtension[])
```

Python:

```python
JavaInjector(shared_volume_name: str, instrumentation_version: InstrumentationVersion, override_environments: typing.Optional[typing.List[EnvironmentExtension]] = None)
```

Java:

```java
new JavaInjector(String sharedVolumeName, InstrumentationVersion instrumentationVersion, List<EnvironmentExtension> overrideEnvironments)
```

C# / .NET:

```csharp
new JavaInjector(string sharedVolumeName, InstrumentationVersion instrumentationVersion, EnvironmentExtension[]? overrideEnvironments = null)
```

Golang:

```go
NewJavaInjector(SharedVolumeName *string, InstrumentationVersion InstrumentationVersion, OverrideEnvironments *[]EnvironmentExtension)
```

## Properties

- `command`: string[] — The command to run the init container.

- `containerPath`: string — The path to ADOT SDK agent in the init container.

## Methods

- `injectInitContainer(taskDefinition: TaskDefinition): ContainerDefinition` — Inject ADOT SDK agent init container.

  **Parameters**

  - `taskDefinition` — The TaskDefinition to render.

  **Returns:** The created ContainerDefinition

- `renderDefaultContainer(taskDefinition: TaskDefinition): void` — Render the application container for SDK instrumentation.

  **Parameters**

  - `taskDefinition` — The TaskDefinition to render.
