Java Client API Prerequisites
In order to practically utilize the powerful features of client-side NCache with your Java client application, make sure to implement the prerequisites discussed below.
Prerequisites
Before using the NCache Java client-side APIs, ensure that the following prerequisites are fulfilled:
- Add the following Maven dependencies for your Java client application in
pom.xmlfile:
<dependency>
<groupId>com.alachisoft.ncache</groupId>
<!--for NCache Enterprise-->
<artifactId>ncache-client</artifactId>
<version>x.x.x</version>
</dependency>
- Import the following packages in your Java client application:
- The cache must be running.
- Make sure that the data being added is serializable.
- To ensure the operation is fail-safe, it is recommended to handle any potential exceptions within your application, as explained in Handling Failures.
- To handle any unseen exceptions, refer to the Troubleshooting section.
Feature Specific Namespaces
Aside from the namespaces employed in most features, you should add the following namespaces/packages/classes based on the feature/API you intend to use and whether or not they require them.
- For Tags, Named Tags, Locking, and Expirations:
- For Cache Data Dependencies, e.g., KeyDependency, FileDependency, and Database Dependencies: [Deprecated]
- For JSON Data: [Deprecated]
- For SQL Queries:
- For Event Notifications:
- For Continuous Query: [Deprecated]
- For Data Structures:
- For Pub/Sub: