Add Asciidoc tag references.
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
* or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package example.app.temp.event;
|
||||
|
||||
import lombok.Getter;
|
||||
@@ -22,6 +21,7 @@ import org.springframework.context.ApplicationEvent;
|
||||
|
||||
import example.app.temp.model.TemperatureReading;
|
||||
|
||||
// tag::class[]
|
||||
public class TemperatureEvent extends ApplicationEvent {
|
||||
|
||||
@Getter
|
||||
@@ -34,3 +34,4 @@ public class TemperatureEvent extends ApplicationEvent {
|
||||
this.temperatureReading = temperatureReading;
|
||||
}
|
||||
}
|
||||
// end::class[]
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
* or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package example.app.temp.geode.client;
|
||||
|
||||
import org.springframework.boot.WebApplicationType;
|
||||
@@ -32,6 +31,7 @@ import example.app.temp.event.TemperatureEvent;
|
||||
import example.app.temp.model.TemperatureReading;
|
||||
import example.app.temp.service.TemperatureMonitor;
|
||||
|
||||
// tag::class[]
|
||||
@SpringBootApplication
|
||||
@EnableEntityDefinedRegions(basePackageClasses = TemperatureReading.class)
|
||||
@UseGroups("TemperatureMonitors")
|
||||
@@ -60,3 +60,4 @@ public class BootGeodeClientApplication {
|
||||
temperatureEvent.getTemperatureReading());
|
||||
}
|
||||
}
|
||||
// end::class[]
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
* or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package example.app.temp.geode.server;
|
||||
|
||||
import java.util.Optional;
|
||||
@@ -38,6 +37,7 @@ import example.app.temp.model.TemperatureReading;
|
||||
import example.app.temp.repo.TemperatureReadingRepository;
|
||||
import example.app.temp.service.TemperatureSensor;
|
||||
|
||||
// tag::class[]
|
||||
@SpringBootApplication
|
||||
@CacheServerApplication(name = "TemperatureServiceServer")
|
||||
@EnableEntityDefinedRegions(basePackageClasses = TemperatureReading.class)
|
||||
@@ -104,3 +104,4 @@ public class BootGeodeServerApplication {
|
||||
return temperatureTimestampIndex;
|
||||
}
|
||||
}
|
||||
// end::class[]
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
* or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package example.app.temp.model;
|
||||
|
||||
import lombok.Data;
|
||||
@@ -24,6 +23,7 @@ import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
import org.springframework.data.gemfire.mapping.annotation.Region;
|
||||
|
||||
// tag::class[]
|
||||
@Data
|
||||
@Region("TemperatureReadings")
|
||||
@RequiredArgsConstructor(staticName = "newTemperatureReading")
|
||||
@@ -65,3 +65,4 @@ public class TemperatureReading {
|
||||
return String.format("%d °F", getTemperature());
|
||||
}
|
||||
}
|
||||
// end::class[]
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
* or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package example.app.temp.repo;
|
||||
|
||||
import java.util.List;
|
||||
@@ -24,6 +23,7 @@ import org.springframework.data.repository.CrudRepository;
|
||||
import example.app.temp.model.TemperatureReading;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
// tag::class[]
|
||||
public interface TemperatureReadingRepository extends CrudRepository<TemperatureReading, Long> {
|
||||
|
||||
List<TemperatureReading> findByTimestampGreaterThanAndTimestampLessThan(Long timestampLowerBound,
|
||||
@@ -36,3 +36,4 @@ public interface TemperatureReadingRepository extends CrudRepository<Temperature
|
||||
Integer countFreezingTemperatureReadings();
|
||||
|
||||
}
|
||||
// end::class[]
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
* or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package example.app.temp.service;
|
||||
|
||||
import java.util.Optional;
|
||||
@@ -28,6 +27,7 @@ import example.app.temp.event.BoilingTemperatureEvent;
|
||||
import example.app.temp.event.FreezingTemperatureEvent;
|
||||
import example.app.temp.model.TemperatureReading;
|
||||
|
||||
// tag::class[]
|
||||
@Service
|
||||
@SuppressWarnings("unused")
|
||||
public class TemperatureMonitor {
|
||||
@@ -65,3 +65,4 @@ public class TemperatureMonitor {
|
||||
.ifPresent(this.applicationEventPublisher::publishEvent);
|
||||
}
|
||||
}
|
||||
// end::class[]
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
* or implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*/
|
||||
|
||||
package example.app.temp.service;
|
||||
|
||||
import java.io.PrintStream;
|
||||
@@ -27,6 +26,7 @@ import org.springframework.util.Assert;
|
||||
import example.app.temp.model.TemperatureReading;
|
||||
import example.app.temp.repo.TemperatureReadingRepository;
|
||||
|
||||
// tag::class[]
|
||||
@Service
|
||||
@SuppressWarnings("unused")
|
||||
public class TemperatureSensor {
|
||||
@@ -57,3 +57,4 @@ public class TemperatureSensor {
|
||||
return temperatureReading;
|
||||
}
|
||||
}
|
||||
// end::class[]
|
||||
|
||||
Reference in New Issue
Block a user