Skip to main content

Posts

Showing posts with the label Java .NET Bridge

Usage and Configuration of the .NET Cache Invalidation Callback

In the previous post, I described a way to intercept in .NET cache invalidate events generated in Java. This post presents the way to configure, use and write your own code that handles the Java generated invalidate events. The entire code presented here is available on this blog's GIT repository. Link here . Java Stuff Modify your cd_storage_conf.xml (located in your .net website /bin/conf folder), and reference class com.tridion.cache.DD4TDependencyTracker as the Feature inside node ObjectCache : <Configuration Version= "7.1" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "schemas/cd_storage_conf.xsd" > <Global> <ObjectCache Enabled= "true" > <Policy Type= "LRU" Class= "com.tridion.cache.LRUPolicy" > <Param Name= "MemSize" Value= "512mb" /> </Policy> ...

.Net Callback from Java Cache Invalidate Message

The problem this post solves is as follows: the Content Delivery API has a mechanism called Cache Decorator, which allows the implementor to define custom code that will be called when things are added/removed/flushed from the internal Tridion Broker Cache. This mechanism allows external actors to interact and synchronize with the Tridion Broker Cache. Namely, a DD4T cache should listen to Tridion Broker Cache messages in order to invalidate its own entries. In Java world, this is simply implemented by extending the CacheDecorator Tridion class. However, in a .NET environment, there is no easy way of intercepting Java method execution back in .NET. This is precisely what this post describes. In a .NET architecture, the Tridion Content Delivery API runs as a Java byte code embedded inside the .NET runtime inside IIS worker process. Communication between .NET and Java happens using a standard called JNI (Java Native Interfaces). Namely the .NET runtime calls Java code that is mapped ...

Executing an ITemplate Inside a JAR TBB

In this post I'll talk a bit about the next functionality of my Java Mediator for SDL Tridion templating -- uploading a JAR containing ITemplate classes into the Content Manager and executing a particular template. JAR Template Building Blocks In a very similar fashion to a .net assembly TBB, I implemented the functionality of having a new Template type for storing JARs inside a TBB, in a binary fashion. These TBBs have a special type, binary, that allows uploading a JAR. A JAR TBB contains Java classes, some of them representing implementations of the ITemplate interface. The actual interface is the TOM.Java proxy tridion.contentmanager.templating.assembly.ITemplate . I created a new Template type in configuration file Tridion.ContentManager.config , under node  < configuration > / < templateTypeRegistry > / < templateTypes > : < add id = " 10 " name = " JAR TBB " mimeType = " application/java-archive " hasBinar...